Skip to content

Fixes #4082 clarify scope defaults #4367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions reference/6/PowerShellGet/Install-Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,11 @@ the computer:

`$home\Documents\PowerShell\Modules`

When no **Scope** is defined, the default is set based on the current session:
When no **Scope** is defined, the default is set based on the PowerShellGet version.

- For an elevated PowerShell session, **Scope** defaults to **AllUsers**.
- For non-elevated PowerShell sessions in [PowerShellGet versions 2.0.0](https://www.powershellgallery.com/packages/PowerShellGet)
and above, the **Scope** is **CurrentUser**.
- For non-elevated PowerShell sessions in PowerShellGet versions 1.6.7 and earlier, **Scope** is
undefined, and `Install-Module` fails.
- In PowerShellGet versions 2.0.0 and above, the default is **CurrentUser**, which does not require
elevation for install.
- In PowerShellGet 1.x versions, the default is **AllUsers**, which requires elevation for install.

```yaml
Type: String
Expand Down Expand Up @@ -498,4 +496,4 @@ the **RequiredVersion** value.

[Uninstall-Module](Uninstall-Module.md)

[Update-Module](Update-Module.md)
[Update-Module](Update-Module.md)