mbx*_*mbx 15 powershell security-policy
使用 Win7-32bit 和 Powershell ISE,我尝试运行刚刚保存的脚本(假设包含一个简单的 cls)。我收到错误消息,通常的“get-help about_signing”建议禁止执行脚本。
当使用“set-executionpolicy remotesigned”来解决时,我得到了一个对话来验证我是否确定。但如果我接受另一个错误出现:
acces to registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" denied
+ set-executionpolicy <<<< remotesigned
+ CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
Run Code Online (Sandbox Code Playgroud)
我该怎么做,以用户身份运行保存的脚本(或作为日常服务自动运行)?
Joh*_*don 15
您需要以管理员身份运行 powershell 来设置执行策略。
将其设置为 remotesigned 后,您就可以以普通用户身份运行 powershell。
只需转到控制面板 -> 管理工具 -> Windows PowerShell 模块(打开 powershell)并键入通常的“set-executionpolicy remotesigned”。就是这样。
| 归档时间: |
|
| 查看次数: |
41840 次 |
| 最近记录: |