WinGet

Microsoft’s official Windows package manager.

mpm reads inventory from winget list --details, whose Key: Value blocks carry the installed version and an Available Upgrades section, and reads search from winget’s fixed-width column table.

Note

installed and outdated keep only rows whose Origin Source is winget, dropping packages winget merely tracks (sideloaded, portable or Microsoft Store). Store entries still surface in search, but their real version cannot be queried through winget, so mpm tags them with an msstore sentinel version and sorts them below winget-native ones.

Warning

Two Windows-only, process-level workarounds keep winget from taking the calling process down with it:

  • winget is spawned with DETACHED_PROCESS. Its COM server and installer children call GenerateConsoleCtrlEvent as they shut down, broadcasting a CTRL_C_EVENT to every process sharing their console: detaching removes winget from that console, so the signal never reaches the caller.

  • WindowsPackageManagerServer.exe is killed by image name after each call. This COM server is activated out-of-process, so it never inherits mpm’s pipes and is never reaped by communicate().

Platforms

  • 🪟 Windows

Operations

Operation

Supported

installed

outdated

search

install

upgrade

upgrade_all

remove

sync

cleanup

Ecosystem

Usage

$ mpm --winget installed
$ mpm --winget search "query"
$ mpm --winget upgrade --all
$ mpm install pkg:winget/hello
$ mpm --dry-run --winget 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-winget, disable it from your configuration, or tune its invocation attributes with per-manager overrides.

Command line

  • CLI names, in lookup order: winget

  • Arguments forced after each call: --accept-source-agreements --disable-interactivity

The version is probed by running:

$ winget --version
PS C:\Users\kev> winget --version
v1.28.220

and extracted with:

r"v(?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 WinGet’s release-age gating, from the cooldown support table:

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 WinGet well and a transcript below looks wrong, or a newer release changed its output format, report it.

PS C:\Users\kev> winget list --details --accept-source-agreements --disable-interactivity
(1/7) CCleaner [CCleaner]
Version: 6.08
Publisher: Piriform Software Ltd
Local Identifier: ARP\Machine\X64\CCleaner
Product Code: CCleaner
Installer Category: exe
Installed Scope: Machine
Installed Architecture: X64
Installed Locale: en-US
Origin Source: winget
Available Upgrades:

(2/7) Git [Git.Git]
Version: 2.37.3
Publisher: The Git Development Community
Origin Source: winget
PS C:\Users\kev> winget list --upgrade-available --details --accept-source-agreements --disable-interactivity
(1/4) Git [Git.Git]
Version: 2.37.3
Publisher: The Git Development Community
Origin Source: winget
Available Upgrades:
  winget [2.45.1]

(2/4) Microsoft Edge [Microsoft.Edge]
Version: 109.0.1518.70
Publisher: Microsoft
Origin Source: winget
Available Upgrades:
  winget [125.0.2535.51]