Prathap
Prathap

Reputation: 399

Add-PSSnapin Windows 10

I am trying to connect and get change sets from my TFS. For that I used this command:

powershell -Command "get-pssnapin -Registered

I got result like

Name        : Microsoft.TeamFoundation.PowerShell
PSVersion   : 2.0
Description : This is a PowerShell snap-in that includes the Team Foundation Server cmdlets.

Name        : WDeploySnapin3.0
PSVersion   : 2.0
Description : This is a PowerShell snap-in that contains cmdlets for managing Microsoft Web Deployment infrastructure.

But when I used this command:

Add-PSSnapin Microsoft.TeamFoundation.PowerShell

I am getting this result:

Add-PSSnapin : Cannot load Windows PowerShell snap-in Microsoft.TeamFoundation.
PowerShell because of the following error: Could not load file or assembly
'Microsoft.TeamFoundation.PowerTools.PowerShell.dll' or one of its
dependencies. The system cannot find the file specified.
At line:1 char:1
+ Add-PSSnapin Microsoft.TeamFoundation.PowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.TeamFoundation.PowerShell:String) [Add-PSSnapin], PSSnapInException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand 

Upvotes: 1

Views: 1787

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31023

Microsoft.TeamFoundation.PowerShell snap-in is from TFS powertools. It seems you have an old version of powertools installed on your machine. I've tested with TFS 2015 powertools on my 64-bit Win10, and got a successful response.

enter image description here

You could check your powertools version and check case TFS Build: `Microsoft.TeamFoundation.PowerShell' is not installed on this computer to see whether the solution helps you.

By the way, you could use .NET client libraries for VSTS (and TFS) instead of powertools snap-in.

Upvotes: 1

Related Questions