inline Chocolatey installer fails in PowerShell
Originally published on May 1st, 2020 (Last updated on May 1st, 2020)
The chocolatey installer might fail when run in PowerShell, saying something like
[File] cannot be loaded. The script will not execute on the system. See about_Execution_Policies
This is caused by the execution-policy of the shell. To allow the installer to work for this session only, the following command can be used:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
This will allow the installer to execute properly. When the shell is closed, everything is reset to normal. Subsequent installs of software from the chocolatey repositories does not need the policy set.
Comments
No comment section here 😄
You can reach me over at @knuth_dev or send me an Email.