private Command(CommandSpec commandSpec) { var psi = new ProcessStartInfo { FileName = commandSpec.Path, Arguments = commandSpec.Args, UseShellExecute = false }; _process = new Process { StartInfo = psi }; ResolutionStrategy = commandSpec.ResolutionStrategy; }
private Command(CommandSpec commandSpec) { var psi = new ProcessStartInfo { FileName = commandSpec.Path, Arguments = commandSpec.Args, RedirectStandardError = true, RedirectStandardOutput = true }; _stdOut = new StreamForwarder(); _stdErr = new StreamForwarder(); _process = new Process { StartInfo = psi }; ResolutionStrategy = commandSpec.ResolutionStrategy; }
private Command(CommandSpec commandSpec) { var psi = new ProcessStartInfo { FileName = commandSpec.Path, Arguments = commandSpec.Args, UseShellExecute = false }; foreach (var environmentVariable in commandSpec.EnvironmentVariables) { if (!psi.Environment.ContainsKey(environmentVariable.Key)) { psi.Environment.Add(environmentVariable.Key, environmentVariable.Value); } } _process = new Process { StartInfo = psi }; }
public static Command Create(CommandSpec commandSpec) { return(new Command(commandSpec)); }
public static Command Create(CommandSpec commandSpec) { return new Command(commandSpec); }