views:

1681

answers:

2

I have installed TFS Power Tools and I am trying to use the powershell snapin, but I can't figure out how to set it up. When I look in the install folder, I only see the following 5 dlls.

Microsoft.TeamFoundation.PowerToys.Client.dll Microsoft.TeamFoundation.PowerToys.Common.dll Microsoft.TeamFoundation.PowerToys.Controls.dll Microsoft.VisualStudio.TeamFoundation.PowerToys.Common.dll Microsoft.VisualStudio.TeamFoundation.PowerToys.dll

I used instalutil to install each one, and then I used the folowing ps code to see what cmdlets where installed so I could add the snapin but it looks like only a handfull exist in those dlls and these commands are not useful to me right now.

PS H:\> get-pssnapin -registered


Name        : TfsBPAPowerShellSnapIn
PSVersion   : 1.0
Description : This is a PowerShell snap-in that includes Team Foundation Server cmdlets.



PS H:\> get-command -pssnapin TfsBPAPowerShellSnapIn

    CommandType     Name                                                Definition
    -----------     ----                                                ----------
    Cmdlet          Get-MsiProductId                                    Get-MsiProductId [[-ProductIndex] <Int32>] [[-Mo...
    Cmdlet          Get-TfsDBServer                                     Get-TfsDBServer [[-DBPath] <String>] [-Verbose] ...
    Cmdlet          Get-TfsHealthPing                                   Get-TfsHealthPing [-Verbose] [-Debug] [-ErrorAct...
    Cmdlet          Get-TfsSqlData                                      Get-TfsSqlData [[-ConnectionBuilder] <SqlConnect...

thanks.

+2  A: 

Any chance you are running on x64? On my x64 system the Microsoft.TeamFoundation.PowerShell snapin only shows up under the x86 flavor of PowerShell. Adding it as simple as:

PS> Add-PSSnapin Microsoft.TeamFoundation.PowerShell

I take it that you installed TF Power Tools October 2008 release. If so, then there is also a shortcut on the start menu for a PowerShell console file that you can fire up. That preloads the TF snapin.

I agree x64 is the most likely reason. You shouldn't need to run installutil at all -- the Power Tools installer does it for you (along with enabling local script execution, if you choose).
Richard Berg
This method failed for me running PowerShell 2 on Windows Server 2008 R2. I get: Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.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.AddPSSnapinCommandAny idea why?
urig
A: 

If you haven't used PowerShell at all yet, you may need to enable the execution of remote scripts to get the PowerShell console in the TF Power Tools Oct 2008 release to work. Open up a Powershell console and type in:

Set-ExecutionPolicy RemoteSigned
Blakomen
You'll want to do that in a PowerShell instance that was launched with administrative privileges.
Rytmis