コード例 #1
0
        public void Test_ExecuteTwoStringsScript()
        {
            var executor = new PowershellScriptExecutor();

            var output = executor.ExecuteScript("two_strings.ps1");

            Assert.AreEqual("Hello world!", output);
        }
コード例 #2
0
        public void Test_ExcecuteHelloScript()
        {
            var executor = new PowershellScriptExecutor();

            var output = executor.ExecuteScript("hello.ps1");

            Assert.AreEqual("Hello world!", output);
        }
コード例 #3
0
        public void Test_ExecuteScriptWithVariable()
        {
            var executor = new PowershellScriptExecutor();

            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables.Add("testVar", "Hello world!");
            var output = executor.ExecuteScript("variable.ps1", variables);

            Assert.AreEqual("Hello world!", output);
        }