Blog
winget Command List
Windows Package Manager (winget) is Microsoft’s official tool for managing software from the command line (PowerShell, CMD). Below is the complete command documentation along with examples for professionals.
| Command | Description | Advanced Example |
|---|---|---|
install |
Installs the selected application. | winget install --id Microsoft.VisualStudioCode --scope machine --silent |
show |
Displays package metadata, SHA256 hashes, and installers. | winget show --id Git.Git --versions |
search |
Searches for applications in connected repositories. | winget search "SQL Server" --tag "database" --limit 10 |
list |
Displays all installed apps (including non-winget ones). | winget list --upgrade-available |
upgrade |
Updates installed applications to their latest versions. | winget upgrade --all --include-unknown --force |
uninstall |
Removes the application from the system. | winget uninstall --name "Docker" --purge |
2. Utility & Configuration Tools
Tools for environment auditing, repo management, and customizing winget behavior.
| Command | Description | Advanced Example |
|---|---|---|
source |
Manages package repositories (Add/Remove/Update). | winget source add --name PrivateRepo --url https://repo.corp.com |
pin |
Restricts a package to a specific version, blocking updates. | winget pin add --id Python.Python.3 |
hash |
Generates the SHA256 hash for a local installer file. | winget hash path\to\setup.exe |
validate |
Validates a manifest file against the winget schema. | winget validate manifest.yaml |
settings |
Opens the JSON configuration file for winget. | winget settings |
features |
Lists experimental features and their current status. | winget features |
3. Provisioning & Infrastructure as Code
Commands for system replication, backup, and mass deployment.
| Command | Description | Advanced Example |
|---|---|---|
export |
Exports the list of installed apps to a JSON file. | winget export -o fleet_config.json --include-versions |
import |
Batch installs apps listed in a JSON configuration file. | winget import -i fleet_config.json --ignore-unavailable |
4. Crucial Global Flags (Parameters)
Mastering these flags is essential for creating reliable automation scripts (PowerShell/CI/CD):
-e, --exact: Forces an exact ID match, preventing accidental installation of similar packages.--silent, --passive: Enables unattended mode.--silenthides all UI, while--passiveshows progress only.--scope [user|machine]: Switches between per-user and system-wide installation (requires Admin).--accept-package-agreements: Automatically accepts EULAs—mandatory for headless scripts.--header: Passes custom HTTP headers (e.g., Auth tokens) for private REST sources.
