winget: make a Windows dev environment repeatable
Use winget to search, install, upgrade and export Windows packages, build a reproducible manifest, and avoid supply-chain traps.
- Build
- 26300.9457
- Edition
- Pro (26H2)
- Architecture
- x64
- Support
- Documentation (E1)
- Evidence
- E1Official documentation
- Verified
- 2026-10-28
- Page type
- Task
The short answer
Section titled “The short answer”winget is the Windows Package Manager. It installs from configured sources (typically winget and msstore) using package IDs. It is good for repeatable developer tools, not for pirated software or random scripts.
The workflow that matters:
winget searchto find the exact ID.winget install --id ... -efor a specific package.winget exportto record what you have.winget importon a new PC.- Re-check IDs/versions before trusting an old manifest.
Check it
Section titled “Check it”winget --versionwinget source listIf winget is missing, install App Installer from the Microsoft Store. On Windows Server, winget support is more limited; check the current docs.
Install and upgrade
Section titled “Install and upgrade”winget search powershellwinget install --id Microsoft.PowerShell -ewinget upgrade --id Microsoft.PowerShell -ewinget upgrade --all-emeans exact ID; use it to avoid a similar-name package.--scope machineinstalls for all users where the package supports it; otherwise it may be per-user.--silent/--accept-package-agreementsare convenient for automation; read what you are accepting.winget listshows installed packages;winget upgradeshows available updates.
Export and import
Section titled “Export and import”winget export -o C:\dev\packages.jsonwinget import -i C:\dev\packages.jsonThe export contains package IDs and source names, not the installer binaries. On a new PC:
- review the JSON before importing;
- remove packages you no longer use;
- check whether a package needs a specific scope/version;
- do not import a manifest from an untrusted repository.
For more complex setups, winget configure uses DSC configuration files. It is powerful and easy to over-apply; start with a small file and read the plan before applying.
Security rules
Section titled “Security rules”- Prefer the official
winget/msstoresources. - Verify the package ID and publisher; a similar name can be a different product.
- Do not add a random third-party source just to get one app.
- Do not use winget to install cracked/pirated software.
- Treat an imported manifest as code: it changes your machine.