The essentials
Quick reference
One focused task per row. Jump to the related section for complete, working examples.
| Use | Syntax | Examples |
|---|---|---|
| Search packages | winget search --query 'PowerShell' | View examples |
| Inspect an exact package | winget show --id Microsoft.PowerShell --exact --source `
winget | View examples |
| List installed packages | winget list | View examples |
| Find one installed ID | winget list --id Microsoft.PowerShell --exact | View examples |
| Install exact package | winget install --id Microsoft.PowerShell --exact `
--source winget | View examples |
| Request user scope | winget install --id Vendor.App --exact --scope user | View examples |
| List upgrades | winget upgrade | View examples |
| Upgrade one package | winget upgrade --id Microsoft.PowerShell --exact | View examples |
| Export package references | winget export --output '.\packages.json' `
--include-versions | View examples |
| Preview an import | winget import --import-file '.\packages.json' `
--ignore-unavailable --disable-interactivity | View examples |
| Pin an installed package | winget pin add --id Vendor.App --exact | View examples |
| List sources | winget source list | View examples |
| Refresh sources | winget source update | View examples |
| Open logs directory | winget --open-logs | View examples |
winget resolves application manifests from configured sources and delegates installers under declared scopes and modes. Use exact package IDs and source names, inspect manifests and agreements, review upgrade candidates, and remember that installer behavior can extend beyond package-manager metadata.
Step by step
Detailed examples
Resolve exact ID, version, architecture, and source
Display names are not unique and may change. Use search, then show with --id, --exact, and --source. Review publisher, installer type, URLs, hashes, scope, dependencies, and agreements; source trust and manifest validation do not make every installer risk-free.
winget search --query 'PowerShell' --source winget
winget show --id Microsoft.PowerShell --exact --source winget Treat installed matching as an inventory hint
winget list correlates registry and package data with known manifests. Some applications may have unknown versions or no source match. Export results for comparison, but use organizational inventory and vulnerability tooling for compliance rather than assuming list is exhaustive.
winget list
winget list --id Microsoft.PowerShell --exact
winget list | Out-File -LiteralPath '.\winget-inventory.txt' -Encoding utf8 Review installer impact before accepting automation
Install and upgrade may trigger elevation, UI, service changes, reboots, or custom exit codes. Request exact identity and scope, avoid blanket agreement flags until terms are approved, and test silent mode. Upgrade one critical package before broad upgrades.
winget show --id Microsoft.PowerShell --exact --source winget
winget install --id Microsoft.PowerShell --exact --source winget
winget list --id Microsoft.PowerShell --exact Use export files as intent, not complete backups
Export records package references, not application data, configuration, licenses, or every installer. Inspect JSON and source identifiers before import. Versions may be unavailable later and installer behavior can change; keep application-specific backup and restore procedures.
winget export --output '.\packages.json' --include-versions
Get-Content -LiteralPath '.\packages.json' -Raw | ConvertFrom-Json | Format-List Control upgrade policy and source trust
Pins affect winget upgrade selection but are not a security patch policy. Source additions expand trust and can introduce package-name ambiguity. Record source URL, type, owner, and approval; qualify commands by source and exact ID.
winget pin list
winget source list
winget source update Preserve command and installer diagnostics
winget errors may arise from source resolution, manifest applicability, download, elevation, or the installer itself. Capture client version, exact command, package ID, exit code, and logs. Do not rerun repeatedly with stronger privileges until the failure stage is known.
winget --version
winget source list
winget show --id Microsoft.PowerShell --exact --source winget
winget --open-logs Sources and further reading
References
Authoritative documentation used to verify and expand this cheat sheet.
Help us improve
Found a typo or missing example?
Tell us what would make this cheat sheet clearer, more complete, or more useful.



