Why is PowerShell "not recognized" when installing Chocolatey?

11.5k views Asked by At

I went to the Chocolatey website and copied the text for installing it and pasted into the administrator cmd.exe (using Windows 7). When I run the command I get:

'powershell' is not recognized as an internal or external command, operable program or batch file.

This GitHub article with Chocolatey installation instructions says:

This really is the easiest method because it requires no configuration of PowerShell prior to executing it.

1

There are 1 answers

1
Still Learning On

It turns out that @balint was right about the path being incorrect. The path variable at some point had gotten replaced instead of appended to. I was able to install Chocolatey successfully after appending all the paths that had been erased previously!

you have some faulty PowerShell installation, or it is missing from the Windows PATH variable. Run in an administrator cmd:

cmd> set PATH=%PATH%;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\