刚刚在一个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位版本的。
转载于:https://blog.51cto.com/lockrock/909633