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 firefox

winget search --id <id> — Search by exact package identifier.

winget search --id Mozilla.Firefox

winget show <package> — Show detailed info about a package.

winget show Mozilla.Firefox

winget show <package> --versions — List all available versions of a package.

winget show Microsoft.VisualStudioCode --versions

Install

winget install <package> — Install a package.

winget install Mozilla.Firefox

winget install <package> --version <ver> — Install a specific version.

winget install Python.Python.3.12 --version 3.12.2

winget install <package> --silent — Install silently (no installer UI).

winget install Microsoft.VisualStudioCode --silent

winget install <package> --location <path> — Install to a custom location.

winget install Git.Git --location D:\Tools\Git

winget install <package> --accept-source-agreements --accept-package-agreements — Install accepting all agreements (non-interactive).

winget install Docker.DockerDesktop --accept-source-agreements --accept-package-agreements

winget install <package> --scope machine — Install for all users (system-wide).

winget install Notepad++.Notepad++ --scope machine

Update & Upgrade

winget upgrade — List all packages with available updates.

winget upgrade

winget upgrade <package> — Update a specific package.

winget upgrade Mozilla.Firefox

winget upgrade --all — Update all packages with available updates.

winget upgrade --all

winget upgrade --all --silent — Update all packages silently.

winget upgrade --all --silent

winget upgrade --include-unknown — Include packages with unknown versions in upgrade.

winget upgrade --all --include-unknown

Uninstall & List

winget uninstall <package> — Uninstall a package.

winget uninstall Mozilla.Firefox

winget uninstall <package> --purge — Uninstall and remove all data/settings.

winget uninstall Microsoft.Teams --purge

winget list — List all installed packages.

winget list

winget list <query> — Search installed packages.

winget list python

winget list --source winget — List only packages from the winget source.

winget list --source winget

Export & Import

winget export -o <file> — Export installed packages to a JSON file.

winget export -o packages.json

winget import -i <file> — Install packages from an exported JSON file.

winget import -i packages.json

winget import -i <file> --accept-source-agreements --accept-package-agreements — Import packages non-interactively.

winget import -i packages.json --accept-source-agreements --accept-package-agreements

Sources & Settings

winget source list — List configured package sources.

winget source list

winget source update — Update all package source indexes.

winget source update

winget source add --name <name> <url> — Add a custom package source.

winget source add --name myrepo https://repo.example.com

winget source remove --name <name> — Remove a package source.

winget source remove --name myrepo

winget settings — Open the winget settings file in the default editor.

winget settings

winget --info — Show winget version, logs path, and links.

winget --info

Pin (Version Lock)

winget pin add <package> — Pin a package to prevent automatic updates.

winget pin add Python.Python.3.12

winget pin add <package> --version <ver> — Pin a package to a specific version.

winget pin add Node.js --version 20.11.0

winget pin list — List all pinned packages.

winget pin list

winget 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

  • apk – Alpine Linux package manager
  • apt – friendly package front-end for Debian/Ubuntu
  • apt-get – the classic, script-stable APT tool