Table of Contents

Class ExecResult

Namespace
DotNetDo
Assembly
DotNetDo.Core.dll

The captured command, directory, output, and exit code of a finished process.

public sealed record ExecResult : IEquatable<ExecResult>

Properties

AllOutput

The process output stream in arrival order.

public required ExecOutput[] AllOutput { get; init; }

Property Value

ExecOutput[]

Command

The exact rendered command text.

public required string Command { get; init; }

Property Value

string

ExitCode

The operating-system process exit code.

public required int ExitCode { get; init; }

Property Value

int

WorkingDirectory

The directory in which the operation executes.

public required string WorkingDirectory { get; init; }

Property Value

string

Methods

ErrorLines()

Returns the captured standard-error messages in observed order.

public string[] ErrorLines()

Returns

string[]

OutputLines()

Returns the captured standard-output messages in observed order.

public string[] OutputLines()

Returns

string[]

ReadJson(JsonSerializerOptions?)

Reads the captured standard output as a JSON document model.

public JsonNode? ReadJson(JsonSerializerOptions? options = null)

Parameters

options JsonSerializerOptions?

Returns

JsonNode?

ReadJson<T>(JsonSerializerOptions?)

Deserializes the captured standard output into the requested value type.

public T? ReadJson<T>(JsonSerializerOptions? options = null)

Parameters

options JsonSerializerOptions?

Returns

T?

Type Parameters

T

ReadText()

Joins the captured standard-output lines using the current environment's newline.

public string ReadText()

Returns

string

ReadToml(TomlSerializerOptions?)

Reads the captured standard output as a TOML document model.

public TomlTable ReadToml(TomlSerializerOptions? options = null)

Parameters

options TomlSerializerOptions?

Returns

TomlTable

ReadToml<T>(TomlSerializerOptions?)

Deserializes the captured standard output into the requested value type.

public T? ReadToml<T>(TomlSerializerOptions? options = null)

Parameters

options TomlSerializerOptions?

Returns

T?

Type Parameters

T

ReadXml()

Reads the captured standard output as an XML document model.

public XDocument ReadXml()

Returns

XDocument

ReadXml<T>()

Deserializes the captured standard output into the requested value type.

public T? ReadXml<T>()

Returns

T?

Type Parameters

T

ReadYaml()

Reads the root node of one YAML document from the captured standard output.

public YamlNode? ReadYaml()

Returns

YamlNode?

ReadYaml<T>(IDeserializer?)

Deserializes one YAML document from the captured standard output.

public T? ReadYaml<T>(IDeserializer? deserializer = null)

Parameters

deserializer IDeserializer?

Returns

T?

Type Parameters

T