powershell禁止系统运行脚本

错误信息:

set-executionpolicy remotesigned

set-executionpolicy : Windows PowerShell 已成功更新你的执行策略,但在更具体的作业域中定义的策略覆盖了该设置。由于发生覆
盖,你的外壳程序将保留其当前的有效执行策略 Restricted。请键入“Get-ExecutionPolicy -List”以查看你的执行策略设置。有关
详细信息,请参阅“Get-Help Set-ExecutionPolicy”。
所在位置 行:1 字符: 1
+ set-executionpolicy remotesigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
+ FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

 

在powershell 运行以下命令

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

 

posted @ 2021-05-25 11:36  时光凉忆  阅读(3204)  评论(0编辑  收藏  举报