y23335793 发表于 2018-9-3 08:59:06

64位机器上的powershell运行时需要注意x64与x86的版本问题

  刚刚在一个64位系统的电脑上,通过cmd运行一个powershell脚本,并且设置了ExecutionPolicy为Unrestricted,但还是报以下异常:
  File cannot be loaded because the execution of scripts is disabled on this system
  这是因为我们在64位系统下,存在两个版本的powershell,一个x64版,还有一个x86版的,两个版本的执行策略不会相互影响,可以把它们看成是两个独立程序一样。上面我的cmd是在32位兼容程序下启动的,所以调用powershell也是32位版本的。
  参考:http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/964636ad-347e-4b23-8f7a-f36a558115dd/

页: [1]
查看完整版本: 64位机器上的powershell运行时需要注意x64与x86的版本问题