PowerShell Gallery¶
PowerShell Gallery client, driven through the modern Microsoft.PowerShell.PSResourceGet module.
Note
Every operation is one PowerShell expression, run non-interactively
with no user profile loaded. Reads emit ConvertTo-Json -AsArray and
are parsed as JSON; outdated has no native cmdlet, so its
installed-versus-gallery comparison runs inside that single pwsh
call rather than as one round trip per installed module.
Note
Only pwsh (PowerShell 7+) is supported. Legacy Windows PowerShell 5.1
is intentionally excluded: it ships PowerShellGet v2, which depends on
the NuGet provider and prompts to trust PSGallery on first install.
PSResourceGet ships bundled with pwsh 7.4+ and supersedes the v2
cmdlets with cleaner, JSON-friendly objects.
Caution
All install and search operations target -Scope CurrentUser so that
mpm does not require elevation. upgrade and remove are scope-
agnostic and operate on whichever scope holds each module.
Caution
Install-PSResource is invoked with -TrustRepository so the
confirmation prompt on the default PSGallery repository is bypassed.
Only the default repository is consulted: third-party PSRepository
registrations are out of scope.
Home page: https://www.powershellgallery.com
Version requirement:
>=7.4.0
Platforms¶
🐧 Linux
🍎 macOS
🪟 Windows
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
✓ |
extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
||
|
Ecosystem¶
Accepted purl types:
pkg:pwsh-gallery
Usage¶
$ mpm --pwsh-gallery installed
$ mpm --pwsh-gallery search "query"
$ mpm --pwsh-gallery upgrade --all
$ mpm install pkg:pwsh-gallery/hello
$ mpm --dry-run --pwsh-gallery upgrade --all
Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Deselect the manager for a single run with --no-pwsh-gallery, disable it from your configuration, or tune its invocation attributes with per-manager overrides.
Command line¶
CLI names, in lookup order:
pwshArguments forced before each call:
-NoProfile -NonInteractive -Command
The version is probed by running:
$ pwsh --version
PowerShell 7.4.6
and extracted with:
r"PowerShell\s+(?P<version>\S+)"
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
See privilege escalation for the full policy.
Cooldown¶
State of PowerShell Gallery’s release-age gating, from the cooldown support table:
Status: ❌ None
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.
Reference traces¶
Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know PowerShell Gallery well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ pwsh -NoProfile -NonInteractive -Command \
"Get-InstalledPSResource | \
Select-Object Name, @{n='Version';e={$_.Version.ToString()}} | \
ConvertTo-Json -AsArray -Depth 2 -Compress"
[{"Name":"PSReadLine","Version":"2.3.6"},
{"Name":"Pester","Version":"5.5.0"}]
$ pwsh -NoProfile -NonInteractive -Command \
"Get-InstalledPSResource | ForEach-Object { ... } | \
ConvertTo-Json -AsArray -Depth 2 -Compress"
[{"Name":"PSReadLine","Installed":"2.3.4","Latest":"2.3.6"}]