this post was submitted on 21 Jul 2023
7 points (100.0% liked)

PowerShell

311 readers
1 users here now

A community dedicated to Microsoft PowerShell.

Rules

  1. Everyone is welcome.
  2. Treat others with respect at all time.
  3. When asking questions, please try to show what you have done, including code.

founded 2 years ago
MODERATORS
 

Hey all, I come from bash and zsh and i'm generally used to tailoring and customizing my experience to what suits me. I want to do the same for my work laptop. I have created a profile.ps1 but due to constrained language mode I cant seem to set aliases or functions because it cant dot source it. What are some viable alternatives? Disclaimer, I'm not looking to bypass the security and policies set here, just alternatives to try and make the experience easier

top 2 comments
sorted by: hot top controversial new old
[–] ccunning 1 points 1 year ago (1 children)

I’ve never had to work in constrainedlanguagemode before and wasn’t even aware of its existence before finding your post.

What are some examples of things you would like to do that it’s preventing?

Is it just dot-sourcing your ps1? Does constrainedlanguagemode block the default profiles from loading too?

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.3

[–] nachom97 1 points 1 year ago

I actually “