Created
October 21, 2021 19:42
-
-
Save yonderbread/74e2d84291e2bec4e996dac9bd73966a to your computer and use it in GitHub Desktop.
PowerShell script to setup and install WSL2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
$WSLUpdateFileName = "wsl_update_x64.msi" | |
$WSLUpdateFileUrl = "https://wslstorestorage.blob.core.windows.net/wslblob/$WSLUpdateFileName" | |
Clear-Host | |
(New-Object System.Net.WebClient).DownloadFile( | |
$WSLUpdateFileUrl, | |
"$env:APPDATA\$WSLUpdateFileName") | |
Start-Process ("$env:APPDATA\$WSLUpdateFileName") | |
wsl --set-default-version 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment