PowerShell unable to Set-Execution policy
I am trying to set the script execution policy in PowerShell.
But when I tried, I get:
PS C:\Users*> Get-ExecutionPolicy
Restricted
PS C:\Users*> Set-ExecutionPolicy RemoteSigned
PS C:\Users*> Get-ExecutionPolicy
Restricted
I tried to run in admin mode, but no difference.
11 Answer
First, make sure you run PowerShell prompt as Administrator, or the proper access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' will be denied.
Afterwhich, try setting it using-force, or set-ExecutionPolicy RemoteSigned -Force.