-
Notifications
You must be signed in to change notification settings - Fork 510
Removals from $ENV:PSModulePath are not respected. #2127
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
Comments
This is due to PowerShell/PowerShell#9921. PSScriptAnalyzer uses a runspace pool internally (and we do in PSES as well) and that resets the PSModulePath. It will be fixed in PS 7 by PowerShell/PowerShell#10300. We are doing other work on the extension at the moment, but will revisit the way we invoke PSScriptAnalyzer down the track. However, because of the way PSSA also uses a runspace pool, this may not be fixable in Windows PowerShell. |
For anyone else experiencing this issue, I would recommend moving all your modules out of your user profile module path and into a system module path. I had about 130 modules in my user profile resting on a remote file share and it was causing near constant progress bars in VS code, and that is fully gone now that they are all in C:\program files\powershell\modules. |
Related: PowerShell PR #10257 |
I seem to have hit this problem. It only affects the integrated console. |
Please elaborate with why they aren't loadable and what you're seeing. I can't repro this behavior. Unfortunately, we can't do anything about this issue until it's:
Until then, we are stuck with this behavior. |
@TylerLeonhardt
and with that in , if I do this as the first thing I type in a session...
Where did the reference to the extensions folder go ? And now any attempt to change the variable always reverts back.
The extension folder is back and I can modify the variable from the prompt. |
System Details Output
Background
At my company, we use user documents redirection, causing my powershell user module folder to be located on a network share. In order to avoid issues with PSModule auto-loading, I remove
$HOME/documents/WindowsPowershell/Modules
from my modulepath and instead add$HOME/WindowsPowershell/Modules
and have relocated all my user specific modules there. This isn't respected in vscode.Expected Behavior
Actual Behavior
Attached Logs
logs.zip
The text was updated successfully, but these errors were encountered: