ProcessConfiguration(String, IEnumerable, Boolean) Constructor

Definition

Namespace CliInvoke.Core
Assembly CliInvoke.Core.dll

Initialises a new instance of the ProcessConfiguration class with the target file path, an argument list, and an output redirection setting; all other properties take the defaults documented on the corresponding properties.

[SetsRequiredMembers]
public ProcessConfiguration(string targetFilePath, IEnumerable<string> argumentList, bool outputRedirection = true)

Parameters

targetFilePath
String

The file path of the executable to be run.

argumentList
IEnumerable<String>

The arguments to pass to the executable as individual list entries. A snapshot is captured; null is rejected with an .

outputRedirection
Boolean

Whether to redirect standard output and error.

Remarks

When argumentList is non-empty, the spawned process receives each entry via rather than a single tokenised Arguments string, preventing double-parse command-injection when a shell wrapper re-interprets the command line. The list is captured as a snapshot; later mutations made to the caller's original collection are not reflected in the configuration.