<p>我正在尝试运行一个<code>cmd</code>文件,该文件从<code>cmd.exe</code>调用PowerShell脚本,但出现以下错误:</p>
<blockquote>
<p><code>Management_Install.ps1</code> cannot be loaded because the execution of scripts is disabled on this system.</p>
</blockquote>
<p>我运行了以下命令:</p>
<pre><code>Set-ExecutionPolicy -ExecutionPolicy Unrestricted
</code></pre>
<p>当我从PowerShell运行<code>Get-ExecutionPolicy</code>时,它返回<code>Unrestricted</code></p>
<pre><code>PS C:\Users\Administrator\> Get-ExecutionPolicy
Unrestricted
</code></pre>
<hr/>
<blockquote>
<p>C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> powershell .\Management_Install.ps1 1</p>
<p>WARNING: Running x86 PowerShell...</p>
<p>File <code>C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1</code> cannot be loaded because the execution of scripts is disabled on this system. Please see "<code>get-help about_signing</code>" for more details.</p>
<p>At line:1 char:25</p>
<ul>
<li><p><code>.\Management_Install.ps1</code> <<<< 1</p>
<ul>
<li><p>CategoryInfo : NotSpecified: (:) [], PSSecurityException</p>
</li>
<li><p>FullyQualifiedErrorId : RuntimeException</p>
</li>
</ul>
</li>
</ul>
<p>C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts> PAUSE</p>
<p>Press any key to continue . . .</p>
</blockquote>
<hr/>
<p>系统是Windows Server 2008R2</p>
<p>我做错了什么</p>