Windows10 に WSL を入れようとして、The term 'Enable-WindowsOptionalFeature' is not recognized …
背景
Windows 10 に WSL を入れようとして、
PS C:\Program Files\PowerShell\6.0.2> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Enable-WindowsOptionalFeature : The term 'Enable-WindowsOptionalFeature' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows- ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Enable-WindowsOptionalFeature:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
みたいなエラーが出たあなた。
や、
Windows Subsystem for Linux - Wikipedia
の通りに正しくやったのに。納得がいかない。
解決法
「Windowsの機能の有効化または無効化」の中から、「Windows Subsystem for Linux」にチェックを入れて、再起動。
で、「Windowsの機能の有効化または無効化」は「コントロールパネル」にあるらしいのだが、その「コントロールパネル」が見つからなかったりするのはお約束。