Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
PowerShell
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], UnauthorizedAcce
ssException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.C
ommands.SetExecutionPolicyCommand
Is there any way to bypass this? Or at least run my powershell code? Please help!
有没有办法绕过这个?或者至少运行我的powershell代码?请帮忙!
1 个解决方案
#1
you can do the following,
你可以做到以下几点,
PowerShell.exe -ExecutionPolicy Bypass -File .runme.ps1
and run this in a cmd prompt
并在cmd提示符下运行它
or copy and paste the whole script in a PS Console
或者将整个脚本复制并粘贴到PS控制台中
\ShellIds\Microsoft.PowerShell' is denied.
At line:1 char:20
+ Set-ExecutionPolicy <<<< Unrestricted
+ CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAcce
ssException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.C
ommands.SetExecutionPolicyCommand
Set-ExecutionPolicy : Access to the registry ke