I am trying to run a cmd file that calls a powershell script from cmd.exe
, and I am getting the below error:
(我正在尝试运行一个从cmd.exe
调用powershell脚本的cmd文件,并且出现以下错误:)
Management_Install.ps1
cannot be loaded because the execution of scripts is disabled on this system.
(无法加载Management_Install.ps1
因为在此系统上禁用了脚本的执行。)
I have run
(我跑了)
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
and when I run Get-ExecutionPolicy
from powershell , I get Unrestricted
back.
(当我从powershell运行Get-ExecutionPolicy
时,我得到了Unrestricted
。)
PS C:UsersAdministrator> Get-ExecutionPolicy
Unrestricted
C:ProjectsMicrosoft.Practices.ESBSourceSamplesManagement PortalInstallScripts> powershell .Management_Install.ps1 1
WARNING: Running x86 PowerShell...
File C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1
cannot be loaded because the execution of scripts is disabled on this system.
(无法加载文件C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1
因为此系统上禁用了脚本的执行。)
Please see " get-help about_signing
" for more details. (请参阅“ get-help about_signing
”以获取更多详细信息。)
At line:1 char:25
(在线:1字符:25)
C:ProjectsMicrosoft.Practices.ESBSourceSamplesManagement PortalInstallScripts> PAUSE
Press any key to continue . . .
The system is Windows Server 2008R2.
(系统是Windows Server 2008R2。)
What am I doing wrong?
(我究竟做错了什么?)
ask by Conor translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…