1

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-Linux

However, 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?
4

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.

This 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.

| improve this answer | |
  • 2
    Enable-WindowsOptionalFeature can only be supported if you are running Window Server 2012+ or Windows 8+ the Windows feature Microsoft-Windows-Subsystem-Linux can only be enabled on Windows 10 Version 1607+. – Ramhound Mar 5 '18 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.