How to find the test controllers registered with Team foundation server 2012?
Here are the steps you should follow to achieve this.
- Copy the following contents to a power shell script file (say fqdn.ps1)
# 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 = “ https://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 ” “
}
- Open a power shell command prompt which has Visual Studio 2012
- Change the collection url to your collection url
$tfsCollectionUrl = “ https://myserver:8080/tfs/mycollection ”;
- Copy the content of the script file and paste on the power shell prompt.
It should return you the names of the test controllers registered with your team foundation server.