When I try to run Enable-WindowsOptionalFeature windows throws ''Enable-WindowsOptionalFeature' is not recognized as an internal or external command, operable program or batch file.'

I am running windows 10.

There is no environment variable called Enable-WindowsOptionalFeature. Should I add it, and if so, what path should I add?

  • 1
    1.The Get-WindowsOptionalFeature cmdlet requires PowerShell 3.0. 2.This cmdlet must run with elevated rights. Right-click the Windows PowerShell 3.0 console while holding the CTRL key, and select Run As Administrator from the action menu – daidai Jan 1 '19 at 7:43

The command you are trying to run cannot be ran in Windows Command Prompt, you need to run it in Windows Powershell.

| improve this answer | |
  • I'm running PowerShell Core as an administration and I'm facing the same problem. Is there another possible cause? – Tomáš Hübelbauer Dec 7 '19 at 8:49

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.