Commands for installing Windows Subsystem for Linux 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.WSL -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.WSL -e --silentwinget uninstall --id Microsoft.WSL -e --silentBy installer
64-bit · MSIX
Silent install
Add-AppxPackage -Path Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundleUninstall
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForLinux | Remove-AppxPackage64-bit · MSI
Silent install
msiexec /i wsl.2.7.14.0.x64.msi /qn /norestartWrite a log
msiexec /i wsl.2.7.14.0.x64.msi /qn /norestart /l*v "%TEMP%\windows-subsystem-for-linux-install.log"Uninstall
msiexec /x {DC52CEBE-E53A-463D-98EE-81AF640914BD} /qn /norestart- MSI product code
- {DC52CEBE-E53A-463D-98EE-81AF640914BD}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DC52CEBE-E53A-463D-98EE-81AF640914BD}
ARM64 · MSIX
Silent install
Add-AppxPackage -Path Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundleUninstall
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForLinux | Remove-AppxPackageARM64 · MSI
Silent install
msiexec /i wsl.2.7.14.0.arm64.msi /qn /norestartWrite a log
msiexec /i wsl.2.7.14.0.arm64.msi /qn /norestart /l*v "%TEMP%\windows-subsystem-for-linux-install.log"Uninstall
msiexec /x {D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61} /qn /norestart- MSI product code
- {D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61}
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-windows-subsystem-for-linux.ps1
$url = 'https://github.com/microsoft/WSL/releases/download/2.7.14/Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundle'
$sha256 = '7BA80E0846C4E82AC3D33165C21A52D95278BAB422EF005461B5E6ACC37CE66B'
$file = Join-Path $env:TEMP 'Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file install-windows-subsystem-for-linux.ps1
$url = 'https://github.com/microsoft/WSL/releases/download/2.7.14/wsl.2.7.14.0.x64.msi'
$sha256 = 'DB084E536279A59E90A26EC598D8AA8A4DFF8309F41D078FD06242953AC1EBCD'
$file = Join-Path $env:TEMP 'wsl.2.7.14.0.x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-windows-subsystem-for-linux.ps1
$url = 'https://github.com/microsoft/WSL/releases/download/2.7.14/Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundle'
$sha256 = '7BA80E0846C4E82AC3D33165C21A52D95278BAB422EF005461B5E6ACC37CE66B'
$file = Join-Path $env:TEMP 'Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file install-windows-subsystem-for-linux.ps1
$url = 'https://github.com/microsoft/WSL/releases/download/2.7.14/wsl.2.7.14.0.arm64.msi'
$sha256 = '3456D37B2F009FB075A1E35366E8B46CE13A7F8355DF63E278D68FCE319C790A'
$file = Join-Path $env:TEMP 'wsl.2.7.14.0.arm64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait