I am trying to write a PowerShell script that automates the deployment of my IIS site. I am trying to run scripts on my computer running Windows Server 2008 R2 under 32-bit versions:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
Whenever I run the WebAdministration command, for example:
Get-Website -Name "MYWebsite"
I get an error message:
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
Switching to the 64-bit version of PowerShell.exe fixes this problem, but it also makes it impossible to use Microsoft Team Foundation Server 2008 Power Tools PSSnapin, which is not suitable for me.
Any idea how I can overcome this? Thanks in advance.
source
share