Powershell說:“在這個系統上,腳本的執行是禁用的。”我在試著CMD調用Powershell腳本cmd.exe,我得到以下錯誤:Management_Install.ps1由于在此系統上禁用了腳本的執行,因此無法加載。我跑了Set-ExecutionPolicy -ExecutionPolicy Unrestricted當我跑的時候Get-ExecutionPolicy從…Powershell,我得到Unrestricted背。PS C:\Users\Administrator\> Get-ExecutionPolicyUnrestrictedC:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\> powershell .\Management_Install.ps1 1WARNING: Running x86 PowerShell...檔案C:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\Management_Install.ps1由于在此系統上禁用了腳本的執行,因此無法加載。請看“get-help about_signing“更多細節。一行:1字符:25.\Management_Install.ps1 <<<< 1類別信息:NotSpecified:(:)[],PSSecurityExceptionFullyQualifiedErrorId:RuntimeExceptionC:\Projects\Microsoft.Practices.ESB\Source\Samples\Management Portal\Install\Scripts\> PAUSEPress any key to continue . . .系統采用WindowsServer2008R2。我做錯什么了?
3 回答

人到中年有點甜
TA貢獻1895條經驗 獲得超7個贊
如果你用WindowsServer 2008R2那么就有一個x64和x86PowerShell的版本,這兩個版本都必須設置它們的執行策略。您在兩臺主機上設置了執行策略嗎?
作為管理員,可以通過在PowerShell窗口中鍵入以下內容來設置執行策略:
Set-ExecutionPolicy?RemoteSigned

呼如林
TA貢獻1798條經驗 獲得超3個贊
我有一個類似的問題,并注意到默認cmd
在……上面WindowsServer 2012正在運行x64一號。
為Windows 7,?Windows 8,?Windows 10,?WindowsServer 2008 R2或WindowsServer 2012,運行以下命令管理員:
x86(32位)
打開C:\Windows\SysWOW64\cmd.exe
運行命令powershell Set-ExecutionPolicy RemoteSigned
x64(64位)
打開C:\Windows\system32\cmd.exe
運行命令powershell Set-ExecutionPolicy RemoteSigned
您可以使用
- 在CMD中:
echo %PROCESSOR_ARCHITECTURE%
- 在Powershell中:
[Environment]::Is64BitProcess
添加回答
舉報
0/150
提交
取消