Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $wsl_state = (Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux).State
- if ($wsl_state) {
- Write-Output "WSL has already been enabled."
- exit(0)
- }
- if ($wsl_state -eq $null) {
- Write-Output "WSL cannot be enabled because it doesn't exist on your PC. Update it to the latest Windows 10."
- exit(1)
- }
- Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Add Comment
Please, Sign In to add comment