'Set-ExecutionPolicy' is not recognized as an internal or external command, operable program or batch file. getting this error while trying to install chocolaty through cmd
Asked
Active
Viewed 5.7k times
4 Answers
28
Set-ExecutionPolicy
is a PowerShell Cmdlet.
You should run it in a PowerShell (Admin-) Session, not in cmd.
Take a look at the installation instructions from chocolatey.org. Official chocolatey documentations is pretty good, as I think:

Malte
- 301
- 2
- 3
-
this is the correct command sequence under this link: https://chocolatey.org/docs/installation @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" – Oliamster Apr 20 '20 at 14:58
1
'Set-ExecutionPolicy' is not recognized as an internal or external command, operable program or batch file while installing chocolaty for this question I think you are using command prompt but Set-ExecutionPolicy is a command only for powershell.

Vikram Singh
- 11
- 1
0
Dont choose command prompt instead of power shell we think that both are same but its not Search Window power shell->run as administrator then run this code