17 12

Install Windows Package Manager

Install:

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Microsoft.WinGet.Client -Force

Run (cmd):
"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.23.1911.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --all --accept-package-agreements --accept-source-agreements

Old approach:
$ProgressPreference = "SilentlyContinue"
$Path = "C:\Users\Public\Downloads"
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.4.11071/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile $Path\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -UseBasicParsing
Invoke-WebRequest -Uri https://kbhost.nl/wp-content/uploads/2022/04/Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip -OutFile $Path\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip -UseBasicParsing
Expand-Archive $Path\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip $Path
Add-AppxPackage -Path "$Path\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe.Appx"
Add-AppPackage -Path "$Path\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"

$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri https://kbhost.nl/wp-content/uploads/2022/04/Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip -OutFile C:\Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip -UseBasicParsing
Expand-Archive C:\Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx.zip C:\
Add-AppxPackage -Path "C:\Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.Appx"

Download, Install and Update from SYSTEM:
$ProgressPreference = "SilentlyContinue"
$Link = "https://codeload.github.com/Romanitho/Winget-AutoUpdate/zip/refs/heads/main"
$Path = "C:\Users\Public\Downloads"
$Dir = "Winget-AutoUpdate-main"
$File = "Winget-AutoUpdate-main.zip"
if (Test-Path $Path\$File) {
  Remove-Item $Path\$File
}
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Expand-Archive $Path\$File $Path -Force
PowerShell -ExecutionPolicy bypass -File $Path\$Dir\Winget-AutoUpdate-Install.ps1

Download and Install from SYSTEM:
$ProgressPreference = "SilentlyContinue"
$Link = "https://codeload.github.com/Romanitho/Winget-Install/zip/refs/heads/main"
$Path = "C:\Users\Public\Downloads"
$Dir = "Winget-Install-main"
$File = "Winget-Install-main.zip"
if (Test-Path $Path\$File) {
  Remove-Item $Path\$File
}
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Expand-Archive $Path\$File $Path -Force

Install software from SYSTEM:
PowerShell -ExecutionPolicy bypass -File $Path\$Dir\winget-install.ps1 -AppIDs Brave.Brave