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