public PowerShellOperation(Dictionary <string, string> parameters)
        {
            if (parameters.ContainsKey("cmd") && !parameters.ContainsKey("file"))
            {
                _commandType = CommandType.ScriptFile;
            }
            else if (!parameters.ContainsKey("cmd") && parameters.ContainsKey("file"))
            {
                _commandType = CommandType.CmdLine;
            }
            else
            {
                throw new ConDepMissingOptionsException(new [] { "cmd or file" });
            }

            _cmd        = parameters.ContainsKey("cmd") ? parameters["cmd"] : null;
            _scriptFile = parameters.ContainsKey("file") ? new FileInfo(parameters["file"]) : null;

            _values = new PowerShellOptions.PowerShellOptionValues();

            if (parameters.ContainsKey("ContinueOnError"))
            {
                _values.ContinueOnError = Convert.ToBoolean(parameters["ContinueOnError"]);
            }
            if (parameters.ContainsKey("RequireRemoteLib"))
            {
                _values.RequireRemoteLib = Convert.ToBoolean(parameters["RequireRemoteLib"]);
            }
            if (parameters.ContainsKey("UseCredSSP"))
            {
                _values.ContinueOnError = Convert.ToBoolean(parameters["UseCredSSP"]);
            }
        }
 public RemotePowerShellHostOperation(FileInfo scriptFile, PowerShellOptions.PowerShellOptionValues values = null)
 {
     _scriptFile  = scriptFile;
     _values      = values;
     _commandType = CommandType.ScriptFile;
 }
 public RemotePowerShellHostOperation(string cmd, PowerShellOptions.PowerShellOptionValues values = null)
 {
     _cmd         = cmd;
     _values      = values;
     _commandType = CommandType.CmdLine;
 }