用于IIS的Windows PowerShell管理单元在32位上失败? [英] Windows PowerShell Snap-In for IIS fails on 32-bit?

查看:220
本文介绍了用于IIS的Windows PowerShell管理单元在32位上失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个PowerShell脚本,该脚本将自动化我的IIS网站部署。我正在尝试在32位以下的Windows Server 2008 R2计算机上运行脚本:

I'm trying to write a PowerShell script that will automate my IIS website deployments. I'm trying to run the scripts on my Windows Server 2008 R2 machine, under 32-bit in:

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

每当我运行一个WebAdministration命令如下:

Whenever I run a WebAdministration command such as this:

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

切换到64位版本的PowerShell.exe可以解决此问题,但无法实现对我来说,也可以使用Microsoft Team Foundation Server 2008 Power Tools PSSnapin,这对我来说是不行的。

Switching to the 64-bit version of PowerShell.exe resolves this issue but makes it impossible for me to also use the Microsoft Team Foundation Server 2008 Power Tools PSSnapin, which is a no-go for me.

我知道如何克服这个问题吗?在此先感谢。

Any idea how I can overcome this? Thanks in advance.

推荐答案

只需连接点。 urig在另一个主题中回答了他自己的问题:
TFS Power Tools 2008 Powershell Snapin将无法在Windows中运行64位2008 R2

Just to connect the dots. "urig" answered his own question in another topic: TFS Power Tools 2008 Powershell Snapin won't run in on 64-bit in Windows 2008 R2

微软的Cathy Kong非常友好地为我提供了解决此问题的方法。详细信息可以在MSDN TFS中找到。 PowerTools论坛: http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/a116799a-0476-4c42-aa3e-45d8ba23739e/?prof=required

"Cathy Kong of Microsoft was kind enough to provide me with a workaround for this issue. The full details can be found here in the MSDN TFS PowerTools forum: http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/a116799a-0476-4c42-aa3e-45d8ba23739e/?prof=required

修复方法如下,对我来说效果很好:

The fix is as follows and worked well for me:

请保存以下内容并将其保存为* .reg文件并导入到注册表(只需双击* .reg文件,单击OK double)

Please save the following content and save it as *.reg file and import to Registry(just double click the *.reg file, click OK double)

Windows注册表编辑器版本5.00

Windows Registry Editor Version 5.00

[ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShe ll\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell]PowerShellVersion=2.0Vendor=Microsoft CorporationDescription=这是包含Team Foundation Server cmdlet的PowerShell管理单元。 VendorIndirect=Microsoft.TeamFoundation.PowerShell,MicrosoftDescriptionIndirect=Microsoft.TeamFoundation.PowerShell,这是一个包含Team Foundation Server cmdlet的PowerShell管理单元。Version=10.0.0.0 ApplicationBase=C:\Program Files(x86)\ Microsoft Office Team Server 2010 Power ToolsAssemblyName=Microsoft.TeamFoundation.PowerTools.PowerShell,Version = 10.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a ModuleName=C:\Program Files(x86)\ Microsoft Microsoft Team Server 2010 Power Tools \ Microsoft.TeamFoundation.PowerTools.PowerShell.dllCustomPSSnapInType=Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell] "PowerShellVersion"="2.0" "Vendor"="Microsoft Corporation" "Description"="This is a PowerShell snap-in that includes the Team Foundation Server cmdlets." "VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft" "DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,This is a PowerShell snap-in that includes the Team Foundation Server cmdlets." "Version"="10.0.0.0" "ApplicationBase"="C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools" "AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ModuleName"="C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\Microsoft.TeamFoundation.PowerTools.PowerShell.dll" "CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"

这篇关于用于IIS的Windows PowerShell管理单元在32位上失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆