Here are the steps you should follow to achieve this.
# Load the binaries
[Reflection.Assembly]::Load(“Microsoft.TeamFoundation.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”); [Reflection.Assembly]::Load(“Microsoft.TeamFoundation.TestManagement.Client, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”);
# Connect to Tfs $tfsCollectionUrl = “http://myserver:8080/tfs/mycollection”; $tfsCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsCollectionUrl); $tcmService = $tfsCollection.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService]); # Query for test controllers $testControllers = $tcmService.TestControllers.Query(); foreach($testController in $testControllers) { Write-Host “Name: “$testController.Name Write-Host ” “ }
$tfsCollectionUrl = “http://myserver:8080/tfs/mycollection”;
It should return you the names of the test controllers registered with your team foundation server.