private PSExecuteConnection TestPSExecute(string script_text)
        {
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection() as PSExecuteConnection;

            conn.ExtractQuery(script_text, new List <QvxTable>());
            return(conn);
        }
        public void ArgumentTest()
        {
            var script = $"PSEXECUTE([\"explorer\", 99])\r\nGet-Process $args[0], $args[1]";
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection();

            conn.MParameters = new Dictionary <string, string>();
            conn.Init();
            conn.ExtractQuery(script, new List <QvxTable>());
        }
        public void ScriptWithUnknownArguments()
        {
            var script = $" \r\n\r\n\r\n\r\n\r\nPSEXECUTE\r\n{GetCommand(false)}\n\r\nmehre unbekannte befehle,.-..\r\nSHA256:\r\n{SignStringWrong};\r\n \r\n \r\n \r\n \r\n ";
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection();

            conn.MParameters = new Dictionary <string, string>();
            conn.Init();
            conn.ExtractQuery(script, new List <QvxTable>());
        }
        public void CheckTestConnectionWithoutCredentials()
        {
            var script = $"PSEXECUTE({Args})\r\n{GetCommand(true)}\r\nSHA256:\r\n{SignString2};";
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection();

            conn.MParameters = new Dictionary <string, string>();
            conn.Init();
            var table = conn.ExtractQuery(script, new List <QvxTable>());

            Assert.Inconclusive();
        }
        public void CheckTestConnectionWithCredentials()
        {
            var credentials = GetTestUserCredentials();

            var script = $"PSEXECUTE({Args})\r\n{GetCommand(true)}\r\nSHA256:\r\n{SignString};";
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection();

            conn.MParameters = new Dictionary <string, string>();
            conn.MParameters.Add("userid", credentials.UserName);
            conn.MParameters.Add("password", credentials.Password);
            conn.Init();
            conn.ExtractQuery(script, new List <QvxTable>());
            Assert.Inconclusive();
        }
        public void CheckTestConnectionWithCredentials()
        {
            //The Standard User Account must be created manually.
            var credentials = GetTestUserCredentials();

            var script = $"PSEXECUTE({Args})\r\n{GetCommand(true)}\r\nSHA256:\r\n{SignString};";
            var server = new PSExecuteServer();
            var conn   = server.CreateConnection();

            conn.MParameters = new Dictionary <string, string>();
            conn.MParameters.Add("userid", credentials.UserName);
            conn.MParameters.Add("password", credentials.Password);
            conn.Init();
            conn.ExtractQuery(script, new List <QvxTable>());
            Assert.Inconclusive("The result will only be evaluated in the future.");
        }