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 }}
Repository navigation
Update and Install-Module Removes Custom PSModulePaths from Current Scope #9845
When you set custom PSModulePaths and then run update-module or install-module for modules, even if they weren't installed through PSGallery, the custom module paths are unloaded from the current scope.
Also, Modules that were installed from PSGallery are not updated, regardless if they are in the default or custom Module paths.
This was tested with the AzureAD module. Closing the current PoSH Window and re-opening reloads all PSModulePaths (even custom ones).
Steps to reproduce
Install-Module <ModuleName>
or
Update-Module <ModuleName>
Expected behavior
Install module if it is available from the repository and not unload PSModulePath that aren't default.
Update module that was installed from repository and not unload PSModulePath that aren't default.
Actual behavior
Installs the module requested and then unloads the custom module paths set for the $Env:PSModulePath
Fails to Update the module (even ones installed from repository) and then unloads the custom module paths set for $Env:PSModulePath
Environment data
Name Value
---- -----
PSVersion 7.0.0-preview.1
PSEdition Core
GitCommitId 7.0.0-preview.1
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Dilydali (@Dilydali) could you please try this with the latest preview of PowerShellGet 3.0? If it's still happening, please file an issue at PowerShell/PowerShellGet
Activity
iSazonov commentedon Sep 16, 2019
Dilydali (@Dilydali) Please add more info in repo steps. Do you update PSModulePath in current session by changing $env:PSModulePaths?
iSazonov commentedon Jan 30, 2020
/cc Steve Lee (@SteveL-MSFT) Perhaps the issue was fixed.
joeyaiello commentedon Jul 30, 2020
Dilydali (@Dilydali) could you please try this with the latest preview of PowerShellGet 3.0? If it's still happening, please file an issue at PowerShell/PowerShellGet