Set-ExecutionPolicy Access To The Registry Key Is Denied – PowerShell

When trying to set the execution policy in PowerShell, you can get the following error:

set-executionpolicy : Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell’ is denied.

This is because PowerShell does not have administrative access to the registry. To fix this:

  1. Close PowerShell
  2. Hold down Ctrl + right click the PowerShell icon
  3. Click Run as Administrator
  4. Type the set-executionpolicy command that gave the Access to the registry key is denied error

Adendum: You can also get around the access to the registry error by adding the following code to your set-executionpolicy command:

 set-executionpolicy RemoteSigned -scope Process -Force

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
Set-ExecutionPolicy Access To The Registry Key Is Denied - PowerShell, 10.0 out of 10 based on 1 rating

Leave a comment

Your email address will not be published. Required fields are marked *