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
{{ message }}
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
I have a little script that I'm working on that attempts to update the PackageManagement and PowerShellGet Modules in PowerShell Core if they're not the latest. It seems like I'm getting a race condition in PowerShell Core beta.6 and 7 when I attempt to update the PackageManagement Module.
Here's a Git Gist with both the script (~100 lines) and the resulting errors I get on PowerShell Core beta.6 and 7 (any OS):
It throws errors as seen in the above Gist in PowerShell Core beta.6 and 7 on any OS.
After the errors are thrown, using 'Get-Module' shows that the latest version of the PackageManagement Module is loaded, but there aren't any ExportedCommands
If I start a new PowerShell Core Session after experiencing the above errors and try the script again, everything works fine
So, the errors are pretty clear that there's a conflict with assembly names that are currently loaded / trying to be loaded, and I understand that the reason that starting a new PowerShell Core Session works is because that's the only way to unload previously loaded assemblies, but maybe there's a way to have PackageManagement.psm1 check to see if certain needed assemblies are already loaded before trying to load them again in PowerShell Core?