add wsl and wsl2
[webi-installers/.git] / wsl2 / install-wsl2.ps1
1 #!/usr/bin/env pwsh
2
3 echo "Installing 1 of 3 Microsoft-Windows-Subsystem-Linux ..."
4 & dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
5
6 echo ""
7 echo "Installing 2 of 3 VirtualMachinePlatform ..."
8 & dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
9
10 echo ""
11 echo "Installing 3 of 3 Microsoft Linux Kernel (wsl_update_x64.msi) ..."
12 & curl.exe -f -o wsl_update_x64.msi "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi"
13 # TODO could we do /quiet /qn to get rid of the popup?
14 powershell -Command "Start-Process msiexec -Wait -ArgumentList '/a wsl_update_x64.msi /quiet /qn TARGETDIR=""$env:TEMP""'"
15 #& msiexec /a "wsl_update_x64.msi" /qb TARGETDIR="$env:TEMP"
16 #Start-Sleep -s 10
17 echo "Copied to $env:TEMP"
18
19 Copy-Item -Path "$env:TEMP\System32\lxss" -Destination "C:\System32" -Recurse
20 echo "Installed C:\System32\lxss\tools\kernel ..."
21
22 Start-Sleep -s 2