本次操作执行的是powershell script file,结果就出错了:
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDiagnostics\PSDiagnostics.psm1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
可能为防止恶意脚本的执行,PowerShell的一个默认执行策略,这个执行策略被设为受限的(Restricted),可以看看是不是这个原因
输入这个命令,查看是不是限制了,Get-ExecutionPolicy –List
可以试试下面这些命令:
Set-ExecutionPolicy Unrestricted
or
Set-ExecutionPolicyRemoteSigned
or
Set-ExecutionPolicyAllSigned
or
Set-ExecutionPolicy Restricted