: PowerShell 5.1 (built-in Windows PowerShell) or PowerShell 7+ (PowerShell Core).
# Establish TLS 1.2 and download paths [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $WingetUrl = "https://github.com" $LicenseUrl = "https://githubusercontent.com" # Download files Invoke-WebRequest -Uri $WingetUrl -OutFile "$env:TEMP\Winget.msixbundle" Invoke-WebRequest -Uri $LicenseUrl -OutFile "$env:TEMP\License.txt" # Register the package provisionally for all users Add-AppxProvisionedPackage -Online -PackagePath "$env:TEMP\Winget.msixbundle" -LicensePath "$env:TEMP\License.txt" -SkipLicense # Verify environment variables are refreshed $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") Use code with caution.
] typically resolves this automatically. * **Source Errors:** you encounter errors like ` 0x801901a0