在Powershell中执行脚本时,有如下报错:

无法加载文件 F:\script\1.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅

"get-help about_signing"。

所在位置 行:1 字符: 8

+ .\1.ps1 <<<<

+ CategoryInfo          : NotSpecified: (:) [], PSSecurityException

+ FullyQualifiedErrorId : RuntimeException


在Powershell中执行如下命令后,即可执行脚本:

set-ExecutionPolicy RemoteSigned