天天看點

在Powershell中禁止執行腳本

在Powershell中執行腳本時,有如下報錯:

無法加載檔案 F:\script\1.ps1,因為在此系統中禁止執行腳本。有關詳細資訊,請參閱

"get-help about_signing"。

所在位置 行:1 字元: 8

+ .\1.ps1 <<<<

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

    + FullyQualifiedErrorId : RuntimeException

在Powershell中執行如下指令後,即可執行腳本:

set-ExecutionPolicy RemoteSigned

本文轉自 zengwj1949 51CTO部落格,原文連結:http://blog.51cto.com/zengwj1949/1964628

繼續閱讀