Windows Subsystem for Linuxを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
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 --silentインストーラー別
64ビット · MSIX
サイレントインストール
Add-AppxPackage -Path Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundleアンインストール
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForLinux | Remove-AppxPackage64ビット · MSI
サイレントインストール
msiexec /i wsl.2.7.14.0.x64.msi /qn /norestartログを出力
msiexec /i wsl.2.7.14.0.x64.msi /qn /norestart /l*v "%TEMP%\windows-subsystem-for-linux-install.log"アンインストール
msiexec /x {DC52CEBE-E53A-463D-98EE-81AF640914BD} /qn /norestart- MSIプロダクトコード
- {DC52CEBE-E53A-463D-98EE-81AF640914BD}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DC52CEBE-E53A-463D-98EE-81AF640914BD}
ARM64 · MSIX
サイレントインストール
Add-AppxPackage -Path Microsoft.WSL_2.7.14.0_x64_ARM64.msixbundleアンインストール
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForLinux | Remove-AppxPackageARM64 · MSI
サイレントインストール
msiexec /i wsl.2.7.14.0.arm64.msi /qn /norestartログを出力
msiexec /i wsl.2.7.14.0.arm64.msi /qn /norestart /l*v "%TEMP%\windows-subsystem-for-linux-install.log"アンインストール
msiexec /x {D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61} /qn /norestart- MSIプロダクトコード
- {D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D121F6A7-AEC9-46A4-94CB-0AF3FF1B5B61}
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
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