Windows 10 Cannot Enable PowerShell Scripting

email me

Something strange happened to me when I was working on some automation for Windows 10. No matter what I did, PowerShell scripting would not enable. See below.

Error

File C:\Setup\Test.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get- help about_signing” for more details. At line:1

 

Fix

Step 1
Open registry, Start > Run > Regedit

Step 2
Navigate to HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell

Step 3
Create ExecutionPolicy as REG_SZ, with value RemoteSigned

Step 4
Open PowerShell and run Get-ExecutionPolicy to verify it is working

 

Notes

If you’re doing an upgrade, make sure you add the above reg key before upgrading.