Beispiel #1
0
        static void Main(string[] args)
        {
            string scriptName = "testrun.ps1";

            string scriptFullFilename = Path.Combine(Environment.CurrentDirectory, "..\\..\\", scriptName);

            scriptFullFilename = Path.GetFullPath(scriptFullFilename);
            if (File.Exists(scriptFullFilename))
            {
                TestRunspace testRunspace = new TestRunspace(scriptFullFilename);
                testRunspace.Execute();

                TestPowershell testPowershell = new TestPowershell(scriptFullFilename);
                testPowershell.AddParameter("From the powershell object");
                testPowershell.Execute();

                testPowershell = new TestPowershell(scriptFullFilename);
                testPowershell.AddParameter("From the asynchronous powershell object");
                testPowershell.ExecuteAsynchronously();
            }
            else
            {
                Console.WriteLine("Script file \"{0}\" does not exist", scriptFullFilename);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            string scriptName = "testrun.ps1";

            string scriptFullFilename = Path.Combine(Environment.CurrentDirectory, "..\\..\\", scriptName);

            scriptFullFilename = Path.GetFullPath(scriptFullFilename);
            if (File.Exists(scriptFullFilename))
            {
                TestRunspace testRunspace = new TestRunspace(scriptFullFilename);
                testRunspace.Execute();
            }
            else
            {
                Console.WriteLine("Script file \"{0}\" does not exist", scriptFullFilename);
            }
        }