Install Winget Using Powershell Updated ((link)) «ULTIMATE – SUMMARY»

How to install winget using PowerShell (updated)

Windows Package Manager (winget) lets you install, update, and manage apps from the command line. This guide shows an updated, step-by-step method to install winget using PowerShell on Windows 10 and Windows 11, including checks and troubleshooting.

Method 2: The Manual Install (For Air-Gapped/Offline Systems)

Best for: Windows Server 2022, systems without Microsoft Store access, or fully offline machines.

If you cannot access the Microsoft Store, you must download the .appxbundle (and its dependencies) manually and install them via PowerShell.

Step 6: Automate Winget Installation and Updates with a Single PowerShell Script

To save time, here’s a master script that checks, installs, and updates Winget in one go. Save it as Update-Winget.ps1: install winget using powershell updated

# Update-Winget.ps1
# Run as Administrator

Write-Host "Checking Winget status..." -ForegroundColor Cyan

try $currentVersion = winget --version Write-Host "Current Winget version: $currentVersion" -ForegroundColor Green catch Write-Host "Winget not found. Installing..." -ForegroundColor Yellow $installRequired = $true

if ($installRequired -or ($args[0] -eq "-force")) Write-Host "Fetching latest Winget release from GitHub..." -ForegroundColor Cyan How to install winget using PowerShell (updated) Windows

$release = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
$asset = $release.assets  else 
Write-Host "Winget is already at the latest version." -ForegroundColor Green

Run it as:

.\Update-Winget.ps1          # Only install if missing
.\Update-Winget.ps1 -force   # Force update even if installed

Step 5: What If Winget Is Installed But Not Working?

Some users report that winget commands hang or fail even after installation. This usually relates to Windows’ execution policy or corrupted sources. Run it as:

Reset the Winget sources:

winget source reset --force

Check your PowerShell execution policy:

Get-ExecutionPolicy

If it’s Restricted, run:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Then retry Winget commands.

Repair the App Installer package using PowerShell:

Get-AppxPackage Microsoft.DesktopAppInstaller | Repair-AppxPackage