Friday, February 13, 2026

Winget full install script

 # 1. Download the latest release binary directly from GitHub

$url = "https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

$outPath = "$env:TEMP\winget_latest.msixbundle"


Write-Host "--- Downloading Latest WinGet Binary ---" -ForegroundColor Cyan

Invoke-WebRequest -Uri $url -OutFile $outPath


# 2. Force the installation (This fixes the 'higher version already installed' conflict)

Write-Host "--- Forcing Package Overwrite ---" -ForegroundColor Cyan

Add-AppxPackage -Path $outPath -ForceUpdateFromAnyVersion -ForceApplicationShutdown


# 3. Clean and Reset Sources

Write-Host "--- Resetting Sources ---" -ForegroundColor Yellow

winget source reset --force


# 4. Final Update (This should now work without the argument error)

winget source update






# 1. Force remove the package for all users and the system provisioned state
Write-Host "Surgically removing App Installer..." -ForegroundColor Red
Get-AppxPackage -AllUsers *DesktopAppInstaller* | Remove-AppxPackage -AllUsers
Get-AppxProvisionedPackage -Online | Where-Object {$_.PackageName -like "*DesktopAppInstaller*"} | Remove-AppxProvisionedPackage -Online

# 2. Verify the command 'winget' is GONE (should return an error)
winget --version

# 3. Re-install the 206MB bundle you already downloaded
Write-Host "Installing fresh modern binary..." -ForegroundColor Cyan
$bundlePath = "$env:TEMP\winget_latest.msixbundle"
Add-AppxPackage -Path $bundlePath

# 4. Final check
winget --version


No comments:

Post a Comment

16.0.19530.20226 -> 16.0.19628.20204

 Package update operation for Package=Microsoft.Office with Manager=Winget Installation options: <InstallOptions instance (only non-defau...