I am attempting to install the Windows Subsystem for Linux on my Windows 7 machine, following the instructions shown in this documentation.
The first step there says to run the command
> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-LinuxHowever, my machine does not recognize the Enable-WindowsOptionalFeature command.
PS C:\> 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- Why does my machine not recognize the
Enable-WindowsOptionalFeature - How can I proceed to install the Windows Subsystem for Linux?
1 Answer
How can I proceed to install the Windows Subsystem for Linux?
The optional Windows feature, Windows Subsystem for Linux, cannot be enabled on Windows 7. What you want is not possible.
Why does my machine not recognize the Enable-WindowsOptionalFeature
Enable-WindowsOptionalFeature is a Windows 8+ only command. The PowerShell cmdlet just uses the DISM module to add/remove Windows Features, in order to do that it requires the version of DISM that comes with Windows 8+, the cmdlet Enable-WindowsOptionalFeature cannot be used on a Windows 7 machine.
1This topic lists the Windows PowerShell modules included with Windows Server 2016 and Windows 10. The Windows PowerShell modules in the list support automating the features of those versions of the Windows operating system and provide links to the cmdlet references for each module. These modules enable you to use Windows PowerShell to administer, maintain, configure, and develop new features for Windows Server 2016 and Windows 10.