Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser RemoteSigned
LocalMachine RemoteSigned
第二步: 然后我就在想,我要去微软的云去验证,这个属性应该是RemoteSigned.当时不是这样的,于是我就写了一条命令如下:
PS C:\WINDOWS\system32> Get-ExecutionPolicy -list
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser RemoteSigned
LocalMachine RemoteSigned
PS C:\WINDOWS\system32> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PS C:\WINDOWS\system32>
第三步,其实还是不可以,然后我就找到另一个命令
Unlblock-File -path "CloudServicesShell.ps1" 想法就是把这个脚本的执行权限去掉。然后神奇的就解决了,脚本就可以执行了。
大家肯定想知道那个脚本代码是什么吧,因为有我们公司的信息,所以不方便外传,实在想要的,留言吧。
原文:http://blog.51cto.com/shadingyu/2140329