我正在嘗試編寫一個PowerShell腳本來自動執行我的IIS網站部署。我試圖運行我的Windows Server 2008 R2的計算機上的腳本,在32位中:針對IIS的Windows PowerShell管理單元在32位上失敗?
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
每當我運行一個WebAdministration命令,像這樣:
Get-Website -Name "MYWebsite"
我得到一個錯誤像這樣:
Get-Website : Retrieving the COM class factory for component with CLSID {688EEE
E5-6A7E-422F-B2E1-6AF00DC944A6} failed due to the following error: 80040154.
At line:1 char:12
+ Get-Website <<<< -Name "MyWebsite"
+ CategoryInfo : NotSpecified: (:) [Get-Website], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Micr
osoft.IIs.PowerShell.Provider.GetWebsiteCommand
切換到PowerShell.exe的64位版本可以解決這個問題,但使它不可能對我來說,還可以使用微軟的Team Foundation Server 2008的電動工具PSSnapin,這是一個沒有-G o對我來說。
任何想法如何克服這一點?提前致謝。
這是一個明確的答案,爲我解決了這個問題 - https://stackoverflow.com/a/6872000/852806 – HockeyJ 2017-11-21 13:56:03