-
Notifications
You must be signed in to change notification settings - Fork 498
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
$env:PSModulePath Question / Potential Issue #1266
Comments
fascinating... sounds like a bug... Thanks for the report! Where does it get the file share path from? Are you adding that to the PSModulePath in your profile or something? It'd be helpful if you could share the logs. |
@tylerl0706 I'm not sure where it gets the file share path from. I took everything out of my profile to eliminate that as an issue. I don't like to assume, but I think as we have our documents redirected, it's using that location instead of the normal C:\Users\User.Name\WindowsPowerShell\Modules location. I've moved all of the modules in there to C:\Program Files\WindowsPowerShell\Modules, and the speed is back to normal. |
Glad to see you're at least unblocked. Seems like a bug. We'll take a look. |
This is becoming a pain for me too. I have a number of module paths being inserted via my profile, and they seem to be overwritten whenever the script analyzer starts up. It's a piece of cake to replicate - is there anything I can provide to help with this? |
Any updates? |
This is caused by an underlying issue within PowerShell: PowerShell/PowerShell#9921. I had hoped it would be fixed in PS 7, but unfortunately PS 7 still mutates the module path when new runspaces are opened. Some approaches we can try:
|
This seems to still be a problem? VSCode v1.92.2, extension v2024.2.2, PowerShell v7.4.5. In my profile I change the order of PSModulePath in process context. It works great in standalone PowerShell consoles, in Windows Terminal, and I've verified with output that the profile runs successfully when VSCode and the extension starts up. But right after when I write Related issues:
This causes conflicting assemblies when trying to load a PowerShell module thats also included with PowerShell, like Microsoft.PowerShell.PSResourceGet. Related issues:
|
I'm having an issue with Intellisense being very slow.
I've managed to whittle it down to VS Code loading modules over the network, so every time I hit tab, it goes off to the network share and does what it needs to do and then Intellisense works.
This can be up to 2 minutes at a time, however.
I removed the entry from $env:PSModulePath in the integrated VS Code terminal, fine, Intellisense is once again rapid and I can continue happily with my work, then around 30 seconds or so later, everything slows down again.
Lo and behold, the UNC of the file share is back in $env:PSModulePath! I've tested this in the ISE and do not get the same issue after removing the UNC share path.
Happy to submit logs if required, hoping there's just something I'm missing, however.
EDIT: It seems to be that when I hit tab or Intellisense trys to fire, it adds the UNC share path back to my $env:PSModulePath. Again tried with the ISE and don't get the same thing, so I believe this to be a bug.
SECOND EDIT: It appears to add the path back into $env:PSModulePath as soon as you click into the editor window.
The text was updated successfully, but these errors were encountered: