Guest User

Untitled

a guest
Aug 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $wsl_state = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux).State
  2. if ($wsl_state) {
  3. Write-Output "WSL has already been enabled."
  4. exit(0)
  5. }
  6. if ($wsl_state -eq $null) {
  7. Write-Output "WSL cannot be enabled because it doesn't exist on your PC. Update it to the latest Windows 10."
  8. exit(1)
  9. }
  10. Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Add Comment
Please, Sign In to add comment