TFS Power Tools 2008 Powershell Snapin 无法在 Windows 2008 R2 中的 64 位上运行

发布于 2024-09-14 20:00:32 字数 916 浏览 5 评论 0原文

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

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

Add-PSSnapin Microsoft.TeamFoundation.PowerShell

在 32 位版本的 PowerShell.exe 中,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 位版本中工作吗?提前致谢。

I've installed TFS Power Tools 2008 along with its PowerShell integration features on my Windows 2008 R2 developer machine.

When I try to run the following command to enable the snapin:

Add-PSSnapin Microsoft.TeamFoundation.PowerShell

in the 32-bit version of PowerShell.exe, under C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe it works fine. But when I try to do the same in the 64-bit version here: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe I get the following error:

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

Any idea how to make it work in the 64-bit version? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

暖树树初阳… 2024-09-21 20:00:32

你把它搞反了。该管理单元是 32 位管理单元。它在 PowerShell (x86) 即 32 位下工作正常,但在 PowerShell (x64) 下不起作用。注意:尽管该文件夹名为 SysWOW64,但它不是 64 位的。在 64 位 Windows 下,本机 64 位二进制文​​件位于 $env:SystemRoot\System32 中。在 Windows-on-Windows64 层下运行的 32 位二进制文​​件(即它们从 32 位进程调用并指向 64 位操作系统调用的指针)位于 $env:SystemRoot\SysWOW64 中。

You got it backwards. The snapin is a 32-bit snapin. It works fine under PowerShell (x86) ie 32-bit but doesn't work under PowerShell (x64). Note: even though the folder is called SysWOW64 it isn't 64-bit. Under 64-bit Windows the native 64-bit binaries go in $env:SystemRoot\System32. The 32-bit binaries that run under Windows-on-Windows64 layer (ie they thunk from a 32-bit process and pointers to 64-bit OS calls) go in $env:SystemRoot\SysWOW64.

邮友 2024-09-21 20:00:32

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"

Registry file for 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"
初雪 2024-09-21 20:00:32

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

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

请保存以下内容并
将其另存为 *.reg 文件并导入到
注册表(只需双击*.reg
文件,单击“确定”两次)

Windows 注册表编辑器版本 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell]
“PowerShell版本”=“2.0”
“供应商”=“微软公司”
“描述”=“这是一个 PowerShell”
包含团队的管理单元
基础服务器 cmdlet。”
“VendorIndirect”=“Microsoft.TeamFoundation.PowerShell,Microsoft”
“DescriptionIndirect”=“Microsoft.TeamFoundation.PowerShell”,这个
是一个 PowerShell 管理单元,其中包括
Team Foundation Server cmdlet。”
“版本”=“10.0.0.0”
“ApplicationBase”=“C:\Program Files”
(x86)\微软团队基础
服务器2010电动工具》
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell,
版本=10.0.0.0,文化=中立,
公钥令牌=b03f5f7f11d50a3a”
“模块名称”=“C:\Program Files”
(x86)\微软团队基础
服务器2010电源
工具\Microsoft.TeamFoundation.PowerTools.PowerShell.dll”
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"

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:

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 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"="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"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文