question
问题.png
这是PowerShell 执行策略是一项安全功能,用于控制 PowerShell 加载配置文件和运行脚本的条件。 此功能有助于防止恶意脚本的执行。类似这样的策略的强制仅在Windows平台上发生,那么本次问题怎样解决呢:
answer
首先管理员模式打开PowerShell输入:
get-executionpolicy //获取有效的执行策略:
执行get-executionpolicy的结果图.png
现在执行策略
set-executionpolicy remotesigned // 并且选择y
end
执行set-executionpolicy remotesigned结果图.png
over
(具体想要了解什么是执行策略请参考)(https://docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1#allsigned)