Enabling and disabling Powershell script execution

By Stephen Kellett
15 August, 2023

If you’ve ever tried to run a script from Powershell you’ve probably seen this error message.

Powershell can't execute script warning message

Enabling script execution

To enable script execution in Powershell open an administrator mode Powershell then type this:

Set-ExecutionPolicy RemoteSigned

When prompted answer with: Y

Future attempts to execute scripts will succeed, in this Powershell prompt and in non-administrator mode Powershell prompts.

Disabling script execution

To disable script execution in Powershell open an administrator mode Powershell then type this:

Set-ExecutionPolicy Default

When prompted answer with: Y

Future attempts to execute scripts will fail, in this Powershell prompt and in non-administrator mode Powershell prompts.

32 bit Powershell on 64 bit machines

If you’re using a 64 bit machine you’ll notice that the execution policy that you set on the 64 bit Powershell doesn’t affect the 32 bit Powershell, and vice versa.

To enable or disable script execution for 32 bit Powershell you need to open 32 bit Powershell in administrator mode and set the execution policy there rather than in the 64 bit system default Powershell.

The system Powershells are:

64 bit C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
32 bit C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

Fully functional, free for 30 days