Raphire / Win11Debloat

A simple, easy to use PowerShell script to remove pre-installed apps from Windows, disable telemetry, remove Bing from Windows search as well as perform various other changes to declutter and improve your Windows experience. This script works for both Windows 10 and Windows 11.
MIT License
14.2k stars 615 forks source link

[Enhancement] Update winget via batch file #89

Open ZaxLofful opened 4 months ago

ZaxLofful commented 4 months ago

When launching on a fresh build of Win 11, there is a winget warning that it needs to be updated.

Have PowerShell update winget right from the beginning, or have it done in the batch file prior to just launching.

ZaxLofful commented 1 month ago

I made a small PowerShell script that will install what is needed:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

$progressPreference = 'silentlyContinue'
$latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_.EndsWith(".msixbundle")}
$latestWingetMsixBundle = $latestWingetMsixBundleUri.Split("/")[-1]
# Define the output directory to the user's main directory
$outputDir = "$Env:USERPROFILE"

Write-Information "Downloading winget to user's main directory..."
Invoke-WebRequest -Uri $latestWingetMsixBundleUri -OutFile "$outputDir\$latestWingetMsixBundle"
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile "$outputDir\Microsoft.VCLibs.x64.14.00.Desktop.appx"

Add-AppxPackage "$outputDir\Microsoft.VCLibs.x64.14.00.Desktop.appx"
Add-AppxPackage "$outputDir\$latestWingetMsixBundle"