When trying to use the set-executionpolicy PowerShell cmdlet, you get:
set-executionpolicy : Access to the registry key
‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell’ is denied.
Access to the PowerShell registry key is denied because you are not running PowerShell as an administrator (This happens even if you are logged in as an administrator, due to UAC). To fix the error denying access to the registry, close PowerShell, hold shift and right click the shortcut to PowerShell then click Run as Administrator.
You should now be able to run the set-executionpolicy cmdlet without error.