2

我已经在我的 Windows 2008 R2 开发人员机器上安装了 TFS Power Tools 2008 及其 PowerShell 集成功能。

当我尝试运行以下命令来启用管理单元时:

Add-PSSnapin Microsoft.TeamFoundation.PowerShell

在 PowerShell.exe 的 32 位版本中,在C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe下它工作正常。但是当我在这里尝试在 64 位版本中执行相同操作时:C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe我收到以下错误:

Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.TeamFoundation.PowerShell' is not installed on this machine.
At line:1 char:13
+ Add-PSSnapin <<<<  Microsoft.TeamFoundation.PowerShell
    + CategoryInfo          : InvalidArgument: (Microsoft.TeamFoundation.PowerShell:String) [Add-PSSnapin], PSArgument
   Exception
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

知道如何使它在 64 位版本中工作吗?提前致谢。

4

3 回答 3

5

你把它弄反了。该管理单元是一个 32 位管理单元。它在 PowerShell (x86) 即 32 位下运行良好,但在 PowerShell (x64) 下无法运行。注意:即使该文件夹名为 SysWOW64,它也不是 64 位的。在 64 位 Windows 下,本机 64 位二进制文​​件位于 $env:SystemRoot\System32。在 Windows-on-Windows64 层下运行的 32 位二进制文​​件(即它们来自 32 位进程和指向 64 位操作系统调用的指针)进入 $env:SystemRoot\SysWOW64。

于 2010-08-17T14:32:13.793 回答
3

TFS Power Tools 2012 的注册表文件:

Windows Registry Editor Version 5.00

[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"="11.0.0.0"
"ApplicationBase"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools"
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ModuleName"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2012 Power Tools\\Microsoft.TeamFoundation.PowerTools.PowerShell.dll"
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"
于 2013-05-12T17:50:52.707 回答
2

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

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

请将以下内容保存为*.reg文件并导入注册表(双击*.reg文件,双击确定)

Windows 注册表编辑器版本 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell] "PowerShellVersion"="2.0" "Vendor"="Microsoft Corporation" "Description"="这是一个包含团队的 PowerShell 管理单元Foundation Server cmdlet。” "VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft" "DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,这是一个包含 Team Foundation Server cmdlet 的 PowerShell 管理单元。" "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,

于 2010-08-26T15:32:50.443 回答