private System.Collections.Generic.List<TestPlan> getTestPlansFromProjectsInPipelineByName(
            System.Collections.Generic.List<TestProject> testProjects,
            System.Collections.Generic.List<TestPlan> testPlans,
            string[] testPlanNames,
            bool makeFail,
            bool inputNotSpecified)
        {
            
            GetTLTestPlanCommand cmdlet = new GetTLTestPlanCommand();

            if (inputNotSpecified) {
                cmdlet.InputObject = null;
            } else {
                TestProject[] projectsArray =
                    testProjects.ToArray();
                cmdlet.InputObject = projectsArray;
            }
            cmdlet.TestPlanName = testPlanNames;
            
            TLAddinData.CurrentTestLinkConnection =
                FakeTestLinkFactory.GetTestLinkWithTestPlans(testProjects, testPlans, null, null);
            
            if (inputNotSpecified) {
                TLAddinData.CurrentTestProject = testProjects[0];
            }
            
            if (makeFail) {
                TLAddinData.CurrentTestLinkConnection = null;
            }
            
            TLSrvGetTestPlanCommand command =
                new TLSrvGetTestPlanCommand(cmdlet);
            command.Execute();
            
            System.Collections.Generic.List<TestPlan> resultList =
                new System.Collections.Generic.List<TestPlan>();

            foreach (object tpl in PSTestLib.UnitTestOutput.LastOutput) {

                resultList.Add((TestPlan)tpl);
            }

            return resultList;
            
        }