关于powershell的执行策略
参考https://learn.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.6
有一堆策略
allsigned
bypass
default
remotesigned
restricted
unrestricted
undefined
默认是undefined,那么这时候用户系统就会采取restricted策略,会禁止运行脚本,服务器系统会采用remotesigned策略
通过Get-ExecutionPolicy -List的命令可以显示所有的执行策略

然后通过Set-ExecutionPolicy -ExecutionPolicy bypass命令可以把执行策略全部设置成bypass
这样就没有阻止了
需要管理员权限运行
黄粱一梦,终是一空
本文来自博客园,作者:sakrain,转载请注明原文链接:https://www.cnblogs.com/sakrain/p/19781233

浙公网安备 33010602011771号