-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
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