TFS Power Tools 2008 Powershell Snapin 无法在 Windows 2008 R2 中的 64 位上运行
我已在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你把它搞反了。该管理单元是 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.
TFS Power Tools 2012 注册表文件:
Registry file for TFS Power Tools 2012:
Microsoft 的 Cathy Kong 非常友善地为我提供了解决此问题的方法。完整的详细信息可以在 MSDN TFS PowerTools 论坛中找到:http://social.msdn.microsoft.com/Forums/en-US/tfspowertools/thread/a116799a-0476-4c42-aa3e-45d8ba23739e/?prof=required< /a>
修复如下,对我来说效果很好:
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: