Powershell: PS Core 6.2 Install-Module default scope changed

Created on 29 Mar 2019  路  3Comments  路  Source: PowerShell/PowerShell

Hi,

I've installed new PS Core 6.2 and it does not install modules for all users (tested on Ubuntu) unless specified -scope AllUsers which per documentation is default.

Issue-Question Resolution-Answered Resolution-External

Most helpful comment

The change was intentional and is related to the version of the PowerShellGet module (which comes with PowerShell Core).

PowerShellGet v2.0 or higher now defaults to -Scope CurrentUser, and PowerShell Core 6.2.0-rc.1 comes with v2.0.4

In short:

  • In PowerShellGet 2.x and going forward, the default is -Scope CurrentUser
  • In PowerShellGet 1.x, the default is -Scope AllUsers

The documentation does state that (though the information is partially incorrect and confusing re 1.x versions): https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-6
Docs issue filed at https://github.com/MicrosoftDocs/PowerShell-Docs/issues/4082

All 3 comments

Please add repo steps and link to the documentation.

The change was intentional and is related to the version of the PowerShellGet module (which comes with PowerShell Core).

PowerShellGet v2.0 or higher now defaults to -Scope CurrentUser, and PowerShell Core 6.2.0-rc.1 comes with v2.0.4

In short:

  • In PowerShellGet 2.x and going forward, the default is -Scope CurrentUser
  • In PowerShellGet 1.x, the default is -Scope AllUsers

The documentation does state that (though the information is partially incorrect and confusing re 1.x versions): https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-6
Docs issue filed at https://github.com/MicrosoftDocs/PowerShell-Docs/issues/4082

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

Was this page helpful?
0 / 5 - 0 ratings