ProcessResult Class

Describes the outcome of a run of IProcessRunner.RunAsync.

This type is not available in the netstandard and .NET Framework builds of Louis, as ProcessRunner is not.

public sealed class ProcessResult

Constructors

NameDescription
ProcessResult(string, int, string, string, TimeSpan)Initializes a new instance of the ProcessResult class.

ProcessResult(string, int, string, string, TimeSpan)

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Initializes a new instance of the ProcessResult class.

public ProcessResult(string commandLine, int exitCode, string standardOutput, string standardError, TimeSpan elapsed)

Parameters

commandLine string
The command line of the process, for display.
exitCode int
The exit code of the process.
standardOutput string
The text the process wrote to its standard output.
standardError string
The text the process wrote to its standard error.
elapsed TimeSpan
The time the run took.

Exceptions

ArgumentNullException
commandLine is null. - or - standardOutput is null. - or - standardError is null.

Properties

NameDescription
CommandLineGets the command line of the process, for display.
ElapsedGets the time the run took.
ExitCodeGets the exit code of the process.
StandardErrorGets the text the process wrote to its standard error.
StandardOutputGets the text the process wrote to its standard output.

CommandLine

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Gets the command line of the process, for display.

public string CommandLine { get; }

Property value

string The executable and the arguments of the run, as CommandLineFormatter.Format shows them.

Elapsed

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Gets the time the run took.

public TimeSpan Elapsed { get; }

Property value

TimeSpan The time from just before the process started to just after it exited.

ExitCode

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Gets the exit code of the process.

public int ExitCode { get; }

Property value

int

StandardError

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Gets the text the process wrote to its standard error.

public string StandardError { get; }

Property value

string An empty string when ProcessRunOptions.InheritStandardStreams is true; otherwise, every line the process wrote, each followed by Environment.NewLine, whatever line terminator the process wrote.

StandardOutput

Available in: net10.0net11.0(not available in the other target frameworks of the package)

Gets the text the process wrote to its standard output.

public string StandardOutput { get; }

Property value

string An empty string when ProcessRunOptions.InheritStandardStreams is true; otherwise, every line the process wrote, each followed by Environment.NewLine, whatever line terminator the process wrote.