Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update and Install-Module Removes Custom PSModulePaths from Current Scope #9845

Copy link
Copy link
@ghost

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
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-PowerShellGetspecific to PowerShellGet modulespecific to PowerShellGet moduleIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-ExternalThe issue is caused by external component(s).The issue is caused by external component(s).WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.