winget — The Windows Package Manager
Practical guide to winget — Microsoft's official package manager for Windows 10/11: search, install, and update apps and reproduce setups with export/import.
winget is Microsoft's official package manager for Windows 10 and 11 – it lets you search, install, update, and remove applications straight from the command line, without clicking through setup wizards. Packages come from the public winget repository (a large community source) and the Microsoft Store, so a single command gets you thousands of common programs. The standout feature is the pair winget export and winget import: capture your software setup as a JSON file and reproduce it on a new or freshly imaged machine. This guide walks you through the commands you reach for daily – from searching to silent installs to pinning individual packages to a specific version.
Search & Info
winget search <query> — Search for packages by name or keyword.
winget search firefoxwinget search --id <id> — Search by exact package identifier.
winget search --id Mozilla.Firefoxwinget show <package> — Show detailed info about a package.
winget show Mozilla.Firefoxwinget show <package> --versions — List all available versions of a package.
winget show Microsoft.VisualStudioCode --versionsInstall
winget install <package> — Install a package.
winget install Mozilla.Firefoxwinget install <package> --version <ver> — Install a specific version.
winget install Python.Python.3.12 --version 3.12.2winget install <package> --silent — Install silently (no installer UI).
winget install Microsoft.VisualStudioCode --silentwinget install <package> --location <path> — Install to a custom location.
winget install Git.Git --location D:\Tools\Gitwinget install <package> --accept-source-agreements --accept-package-agreements — Install accepting all agreements (non-interactive).
winget install Docker.DockerDesktop --accept-source-agreements --accept-package-agreementswinget install <package> --scope machine — Install for all users (system-wide).
winget install Notepad++.Notepad++ --scope machineUpdate & Upgrade
winget upgrade — List all packages with available updates.
winget upgradewinget upgrade <package> — Update a specific package.
winget upgrade Mozilla.Firefoxwinget upgrade --all — Update all packages with available updates.
winget upgrade --allwinget upgrade --all --silent — Update all packages silently.
winget upgrade --all --silentwinget upgrade --include-unknown — Include packages with unknown versions in upgrade.
winget upgrade --all --include-unknownUninstall & List
winget uninstall <package> — Uninstall a package.
winget uninstall Mozilla.Firefoxwinget uninstall <package> --purge — Uninstall and remove all data/settings.
winget uninstall Microsoft.Teams --purgewinget list — List all installed packages.
winget listwinget list <query> — Search installed packages.
winget list pythonwinget list --source winget — List only packages from the winget source.
winget list --source wingetExport & Import
winget export -o <file> — Export installed packages to a JSON file.
winget export -o packages.jsonwinget import -i <file> — Install packages from an exported JSON file.
winget import -i packages.jsonwinget import -i <file> --accept-source-agreements --accept-package-agreements — Import packages non-interactively.
winget import -i packages.json --accept-source-agreements --accept-package-agreementsSources & Settings
winget source list — List configured package sources.
winget source listwinget source update — Update all package source indexes.
winget source updatewinget source add --name <name> <url> — Add a custom package source.
winget source add --name myrepo https://repo.example.comwinget source remove --name <name> — Remove a package source.
winget source remove --name myrepowinget settings — Open the winget settings file in the default editor.
winget settingswinget --info — Show winget version, logs path, and links.
winget --infoPin (Version Lock)
winget pin add <package> — Pin a package to prevent automatic updates.
winget pin add Python.Python.3.12winget pin add <package> --version <ver> — Pin a package to a specific version.
winget pin add Node.js --version 20.11.0winget pin list — List all pinned packages.
winget pin listwinget pin remove <package> — Remove a pin from a package.
winget pin remove Python.Python.3.12 Conclusion
winget finally makes Windows a system you can manage like a modern developer setup: one command instead of download, double-click, and "Next, Next, Finish". Its biggest payoff comes from pairing winget export with winget import – document your entire software state and restore it reproducibly on a new machine. On the first run, watch the license and source agreements: --accept-source-agreements and --accept-package-agreements make installs scriptable, but they also accept the license terms of every package, so use them deliberately. Prefer installing from the trusted default sources winget (community repository) and msstore (Microsoft Store), and be cautious with sources you add yourself. With winget upgrade --all you keep your whole system current in one pass, while pinned packages stay locked to their chosen version.
Further Reading
- Windows Package Manager – Microsoft Learn – official winget documentation
- winget command reference – Microsoft Learn – every subcommand and option in detail
- winget-cli on GitHub – source code, releases and issue tracker