You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is something that can be fixed, but it's been showing up for me very often, a lot for PowerShell 7.3, never for PowerShell 5.1 and sometimes for newer PowerShell versions.
I develop my modules in VSCode. Once I'm happy with the module that it works enough I combine everything, including DLLs, and push it to standard PowerShell module folders so my apps can use it. This is my so-called "production" version that I know works correctly and can be publish to psgallery. But then I continue working with the non-production version in VSCode.
Whenever I open PowerShell 7 and do Import-Module .\Mymodule.psd1 -Force it claims the DLLs are already loaded.
Of course the warning comes from my PSM1 where I explicitly detect the error when I try to do Add-Type and prevent it.
I tried tracking it - Whenever I open PowerShell 7 (doesn't seem to show up in 5.1) it seems that it already preloads DLL's. I can see this with:
It doesn't happen all the time, but enough time for me to notice. Those DLL's have now loaded
But the module itself did not:
My understanding is - it happens when I switch between files (just by reading them), not even running and loads DLL's in the background making a problem for development (assuming that I would like to change DLL version for example). So my guess is VSCode PowerShell wants to help me - but at the same time it impacts module development.
While I can deal with it internally I'm guessing a lot of other people may not be as happy.
PowerShell Version
Name Value---- -----PSVersion 7.3.0-preview.3PSEdition CoreGitCommitId 7.3.0-preview.3OS Microsoft Windows 10.0.22000Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0
Could be intellisense, if you intellisense a portion of a name of a command that's advertised in a module as part of PSModulePath, it'll import it so it can read the help/parameters/etc.
I usually do my module testing (pester etc.) using the "use separate powershell process" aspect, so I don't have to worry about what my "primary" PSIC has in it.
Could be CodeLens, that's why I said it may not be fixable - but it started happening in Preview. Haven't seen this in production version so maybe the extension is just too eager to start (which is understandable if you see my earlier complains🤣).
Prerequisites
Summary
I am not sure if this is something that can be fixed, but it's been showing up for me very often, a lot for PowerShell 7.3, never for PowerShell 5.1 and sometimes for newer PowerShell versions.
I develop my modules in VSCode. Once I'm happy with the module that it works enough I combine everything, including DLLs, and push it to standard PowerShell module folders so my apps can use it. This is my so-called "production" version that I know works correctly and can be publish to psgallery. But then I continue working with the non-production version in VSCode.
Whenever I open PowerShell 7 and do
Import-Module .\Mymodule.psd1 -Force
it claims the DLLs are already loaded.Of course the warning comes from my PSM1 where I explicitly detect the error when I try to do Add-Type and prevent it.
I tried tracking it - Whenever I open PowerShell 7 (doesn't seem to show up in 5.1) it seems that it already preloads DLL's. I can see this with:
It doesn't happen all the time, but enough time for me to notice. Those DLL's have now loaded
But the module itself did not:
My understanding is - it happens when I switch between files (just by reading them), not even running and loads DLL's in the background making a problem for development (assuming that I would like to change DLL version for example). So my guess is VSCode PowerShell wants to help me - but at the same time it impacts module development.
While I can deal with it internally I'm guessing a lot of other people may not be as happy.
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
As described above.
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: