打开Windows Powershell Modules报错

在阿里云Windows Server里进入PowerShell的时候一直报如下错误:

警告: 无法加载文件
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDiagnostics\PSDiagnostics.psm1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 “get-help about_signing”。

警告: 无法加载文件
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\WebAdministration\WebAdministrationAliases.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 “get-help about_signing”。

进入PowerShell,执行:

1
set-executionpolicy remotesigned

选择之后再进入PowerShell,警告消失。

Fiveplus wechat
扫一扫上方二维码,关注微信公众号:阿五编程
如果这篇文章对你有所帮助,请点击下方的打赏按钮。