Table of Contents

API Reference

The reference pages in this section are generated from the XML documentation in the source code, so they always match the shipped package; the table below is a map of where to start.

Invex.Process

Type Kind Description
IProcessRunner Interface Injectable service for executing external processes. Exposes synchronous Run and asynchronous RunAsync. Registered as a singleton.
ProcessRunOptions Record Immutable configuration for a single execution: executable name, arguments, working directory, environment variables, log levels, per-line transforms, and failure tolerance.
ProcessRunResult Record The result of a completed execution: exit code, full captured stdout/stderr, and the originating options.
ProcessException Exception Thrown on a non-zero exit (unless AllowFailedResult is set); carries the exit code and the full ProcessRunResult.
ProcessHostExtensions Static class IServiceCollection extensions; call AddProcessRunner() once during host setup.

Typical flow

  1. Register the runner with AddProcessRunner() from ProcessHostExtensions.
  2. Inject IProcessRunner where you need to shell out.
  3. Build a ProcessRunOptions describing the invocation.
  4. Call Run or RunAsync and use the returned ProcessRunResult.
var result = await processRunner.RunAsync(
    new ProcessRunOptions("git", "rev-parse HEAD")
    {
        WorkingDirectory = repoRoot,
    },
    cancellationToken);

var commitSha = result.Output.Trim();

For conceptual documentation, see the Introduction; for what you can rely on between releases, see Versioning.