Set-ExecutionPolicy :
Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied. At line:1 char:20
+ set-ExecutionPolicy <<<< unrestricted
+ CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
+ CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
Solution:
1) This error is often displayed because you are not executing the command
as an administrator.
To solve this issue, try the following.
Right-click or hold Shift and select Windows PowerShell > Run as administrator.
If the above approach doesn't resolve then try step 2
2)Run: regedt32
* Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell
* Right-Click > Permissions
* Select, and add your account, grant it "Full Control" privileges as shown in below figure