Class ProcessRunResult
- Namespace
- Invex.Process
- Assembly
- Invex.Process.dll
Represents the result of a completed external-process execution.
public sealed record ProcessRunResult
- Inheritance
-
objectProcessRunResult
Remarks
Both Output and Error are always populated with whatever the process wrote, regardless of the log levels configured in RunOptions. This means callers can inspect the full output in error-handling logic even when debug logging was disabled during the run.
Lines suppressed by TransformOutput or
TransformError (i.e. where the transform returned
null) are excluded from the captured text; transformed lines appear in their
transformed form.
For processes run with AllowFailedResult set to
false (the default), this record is only returned when ExitCode
is zero — otherwise IProcessRunner throws before returning.
Constructors
ProcessRunResult(ProcessRunOptions, int, string, string)
Represents the result of a completed external-process execution.
public ProcessRunResult(ProcessRunOptions RunOptions, int ExitCode, string Output, string Error)
Parameters
RunOptionsProcessRunOptionsThe options that were used to run the process.
ExitCodeintThe exit code returned by the process upon termination.
OutputstringThe complete standard output (stdout) captured from the process. Each captured line is terminated by System.Environment.NewLine; empty when the process wrote nothing.
ErrorstringThe complete standard error (stderr) captured from the process. Each captured line is terminated by System.Environment.NewLine; empty when the process wrote nothing.
Remarks
Both Output and Error are always populated with whatever the process wrote, regardless of the log levels configured in RunOptions. This means callers can inspect the full output in error-handling logic even when debug logging was disabled during the run.
Lines suppressed by TransformOutput or
TransformError (i.e. where the transform returned
null) are excluded from the captured text; transformed lines appear in their
transformed form.
For processes run with AllowFailedResult set to
false (the default), this record is only returned when ExitCode
is zero — otherwise IProcessRunner throws before returning.
Properties
Error
The complete standard error (stderr) captured from the process. Each captured line is terminated by System.Environment.NewLine; empty when the process wrote nothing.
public string Error { get; init; }
Property Value
- string
ExitCode
The exit code returned by the process upon termination.
public int ExitCode { get; init; }
Property Value
- int
Output
The complete standard output (stdout) captured from the process. Each captured line is terminated by System.Environment.NewLine; empty when the process wrote nothing.
public string Output { get; init; }
Property Value
- string
RunOptions
The options that were used to run the process.
public ProcessRunOptions RunOptions { get; init; }