| Task | PowerShell Command | | :--- | :--- | | | Get-Command winget | | Fastest Install | Repair-WinGetPackageManager | | Manual Bundle Install | Invoke-WebRequest -Uri "https://aka.ms/getwinget" -OutFile "$env:TEMP\winget.msixbundle"; Add-AppxPackage "$env:TEMP\winget.msixbundle" | | Force Reset | Get-AppxPackage *DesktopAppInstaller* | Reset-AppxPackage | | Update Winget | winget upgrade --id Microsoft.AppInstaller |
This command goes to the internet. It finds the latest WinGet file. It installs the file on your PC immediately. Step 4: Verify the Installation
After running any of the above, restart your PowerShell session and type: powershell winget --version Use code with caution. Copied to clipboard Why use PowerShell for this? Automation : It allows for "headless" setups on new Windows machines. Bypassing UI
Start-Process "ms-windows-store://pdp/?productid=9NBLGGH4NNS1" install winget using powershell hot
Alternatively, you can quickly grab the bundle via a web request: Stack Overflow powershell
If you are on a system without any prerequisites (like VCLibs or Xaml), this community-maintained script from handles the entire dependency chain. Download and run the installer script: powershell Install-Script -Name winget-install winget-install Use code with caution. Copied to clipboard
Install-Script -Name winget-install -Force | Task | PowerShell Command | | :---
Start-Process "ms-windows-store://pdp/?ProductId=9nblggh4nns1"
Whether you're a system administrator automating deployment or a power user looking to speed up your workflow, Winget will save you an immense amount of time. Keep this guide handy, and don't hesitate to use the -Force or -Debug parameters if you ever run into issues in the future.
Navigate to the directory where the script was downloaded. For example: Step 4: Verify the Installation After running any
If the repository is not enabled, you'll see an error message. To enable it, run:
:A popular community-driven method involves a one-liner script from GitHub (gerardog/winget-installer) that automatically handles dependencies like VCLibs and Xaml. powershell
# Install the package provider and WinGet client module Install-PackageProvider -Name NuGet -Force | Out-Null Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null # Use the repair cmdlet to bootstrap/install the WinGet client Repair-WinGetPackageManager -AllUsers Use code with caution. Copied to clipboard Option 2: The Direct Download Script