-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dot-source issue #228
Comments
Hi nemchik, can you give us the output of |
I just found this blogpost: If I set this EnvironmentVariable: my LanguageMode is "ConstrainedLanguage" and I get the same error message. I also can't override the Environment Variable in ConstrainedLanguage-Mode, so I had to set it manually in the Environment Variables (Windows-Key + PAUSE -> Advanced system settings -> Environment Variables). You can try the LanguageMode locally via the Environment Variable if you set "__PSLockdownPolicy" to 0 (works for me). If posh-git shouldn't use dot-sourcing you'd need to include all the functions in the module file (psm1), but I don't think that it will work in such an restricted shell. |
I'm trying to get us to ditch the GPO entirely because it's been a nightmare and caused more issues than it's solved, but that's a hard sell. |
it seems there are other articles on the internet where people are having similar issues with software restriction policies (which is what I'm running into) and powershell language. This particular link doesnt seem to have a resolution though :( |
Did you start a new Powershell after setting the environment variables? |
You can confirm if the variable is set by executing: |
Yes I started a new powershell every time I set or changed the value. Having the environment variable set did not seem to stop the original error from showing. I confirmed just now by again adding the environment variable and then closing and reopening powershell, seeing the error, and then running Unfortunately it doesn't seem to help. Removing my machine from the software restriction GPO does resolve the issue, but I'm only granted that privilege for testing and certain special cases. |
@nemchik were you able to resolve this? |
Unfortunately no, the only solution I've found is being removed from the group policy that has the software restriction. Everything works fine when I'm out, but being in the software restriction still causes issues. |
I have no idea how to fix it, but I found some stuff written since you opened the issue that confirms what you're seeing as being related to policy:
I wonder if the changes being discussed in #328 (essentially writing an |
I don't think there is anything we can do in posh-git to make it work under locked GPO policy. Not only was dot sourcing prevented but |
Agreed. If anyone has more information about steps we could take to mitigate this, please leave a note (or open a PR!) and we'll do what we can. |
I've run into an issue where there is a Group Policy enforced on my computer (at work) and somehow it doesn't like dot-source in PowerShell. I'm not even sure what would need to be changed in the GPO in order to resolve this, and I'm not in direct control of the GPO (but I can make requests).
Anyway the issue I'm affected by is this error
I've done a decent amount of Google-fu with no luck.
So I guess this issue has two possible resolutions;
The text was updated successfully, but these errors were encountered: