Skip to content

Instantly share code, notes, and snippets.

@tats-u
Last active March 14, 2019 16:17
Show Gist options
  • Save tats-u/9aa7009c67f0454ddf7a88ce528a8299 to your computer and use it in GitHub Desktop.
Save tats-u/9aa7009c67f0454ddf7a88ce528a8299 to your computer and use it in GitHub Desktop.
WSL有効化PowerShellスクリプト(管理者権限で実行してください)
$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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment