English 中文(简体)
TFS Power Tools 2008 Powershell Snapin won t run in on 64-bit in Windows 2008 R2
原标题:

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:WindowsSysWOW64WindowsPowerShellv1.0powershell.exe it works fine. But when I try to do the same in the 64-bit version here: C:Windowssystem32WindowsPowerShellv1.0powershell.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_MACHINESOFTWAREMicrosoftPowerShell1PowerShellSnapInsMicrosoft.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 ToolsMicrosoft.TeamFoundation.PowerTools.PowerShell.dll" "CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"

问题回答

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:SystemRootSystem32. 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:SystemRootSysWOW64.

Registry file for TFS Power Tools 2012:

Windows Registry Editor Version 5.00

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




相关问题
Why not use TFS as a build / CI solution?

Currently our build solution is set up using TFS + MS Build scripts. TFS is also being used as a CI server. I ve seen several posts on this site telling people about other CI solutions. Are there ...

Get files from TFS under Linux [closed]

is there a free (command line) tool for linux which with I can get all files from a TFS-Repository (no Check in / Check out required - only get actual version)?

upgrading tfs 2008 sp1 to use sql server 2008

I have an instance of tfs 2008 supported by sql server 2005. I want to change the sql server machine by doing a restore based move. I also want to change the version of sql server to 2008. I know ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

TFSReg in 2010 Beta 2?

does anybody know what is the equivalent of the TFSReg.exe command-line tool in 2010 Beta 2? I cannot find it anywhere, I searched the entire Program Files tree. Was it renamed? Moved? Replaced by ...

热门标签