我已经在我的 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 位版本中工作吗?提前致谢。
请您参考如下方法:
你搞反了。管理单元是一个 32 位管理单元。它在 PowerShell (x86) 下工作正常,即 32 位,但在 PowerShell (x64) 下不起作用。注意:即使该文件夹名为 SysWOW64,它也不是 64 位的。在 64 位 Windows 下, native 64 位二进制文件位于 $env:SystemRoot\System32 中。在 Windows-on-Windows64 层下运行的 32 位二进制文件(即它们从 32 位进程和指向 64 位操作系统调用的指针)进入 $env:SystemRoot\SysWOW64。