Monday, April 26, 2010 11:05 PM
Using VS2010, in C#, I get a ITestManagementService project, and execute project.TestPlans.Query("SELECT * FROM TestPlan"));
However, in powershell $project.TestPlans is null. What am I doing wrong?
[psobject] $tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($tfsServerUri)
[psobject] $tms = $tfs.GetService([Microsoft.TeamFoundation.TestManagement.Client.ITestManagementService]);
[psobject] $project = $tms.GetTeamProject($tfsProjectName)
[psobject] $testplans = [Microsoft.TeamFoundation.TestManagement.Client.ITestManagementTeamProject]$project.TestPlans
Tuesday, April 27, 2010 5:24 AM
I am moving this post to Testing with Visual Studio Test Manager (MTM) Forum so you can get better and quicker response as there are more experts on it.
Thanks for your understanding.
Edwer Fang [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at email@example.com.
Friday, February 18, 2011 6:22 PMI have the same problem.
Thursday, May 03, 2012 2:29 PM
Same problem here.
Thursday, May 03, 2012 3:28 PMI belive you need to explicitly load some assemblies. Try Microsoft.TeamFoundation.TestManagement.Client.
Monday, November 12, 2012 11:05 AMOwner
This is happening because of following bug in powershell.
And as mentioned in the above bug, you can use reflection or the Get-Interface method to access it.
Here is the poweshell snippet I used to make it work.
[Microsoft.TeamFoundation.TestManagement.Client.ITestManagementTeamProject] $tcmProject = $tcmService.GetTeamProject($projectName);
$testPlansProperty = [Microsoft.TeamFoundation.TestManagement.Client.ITestManagementTeamProject].GetProperty("TestPlans").GetGetMethod();
$testPlans = $testPlansProperty.Invoke($tcmProject, "instance,public", $null, $null, $null);