Commands for installing Windows SDK without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Microsoft.WindowsSDK.10.0.18362 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.WindowsSDK.10.0.18362 -e --silentwinget uninstall --id Microsoft.WindowsSDK.10.0.18362 -e --silentBy installer
32-bit · EXE
Silent install
winsdksetup.exe /qPowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-windows-sdk-microsoft.ps1
$url = 'https://download.microsoft.com/download/4/2/2/42245968-6A79-4DA7-A5FB-08C0AD0AE661/windowssdk/winsdksetup.exe'
$sha256 = '2E28117E82B4D02FE30D564B835ACE9976612609271265872F20F2256A9C506B'
$file = Join-Path $env:TEMP 'winsdksetup.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/q' -Wait