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.
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.
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:
Registry file for TFS Power Tools 2012: