Search code examples
powershellchocolatey

'PowerShell' is not recognized as an internal or external command


I have just installed Chocolatey via PowerShell, I tried running PowerShell both as myself and as administrator, and if I try running choco or cinst I get the following error:

PS C:\> choco /?
'PowerShell' is not recognized as an internal or external command,
operable program or batch file.

What do I do? I have a feeling this is related to more than just Chocolatey...


Solution

  • This can happen if a program is not on your PATH. Open a PowerShell prompt and enter

    [environment]::setEnvironmentVariable('PATH',
    "$env:path;C:\Windows\System32\WindowsPowerShell\v1.0", 'm')
    

    then restart PowerShell.