«

因為這個系統上已停用指令碼執行(PowerShell)

Paladin 发布于 阅读:7 Windows


因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\Default\Documents\PS\shutdown.ps1 檔案。如需詳細資訊,請參閱 about_Execution_Policies,網址為 https:/go.microsoft.com/fwlink/?LinkID=135170。

+ CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess

解决方案:

以系統管理員權限執行 PowerShell,執行以下指令:

Set-ExecutionPolicy RemoteSigned

使作業系統接受所有自訂或信任來源的 Script,如此問題便解決啦。

PowerShell