The code above spawns a child process with the configured command line arguments and working directory, and then asynchronously waits for it to exit.Īfter the task has completed, it resolves to a CommandResult object that contains the process exit code and other related information.ĬliWrap will throw an exception if the underlying process returns a non-zero exit code, as it usually indicates an error. ![]() Var result = await Cli.Wrap("path/to/exe") Once the command is configured, you can run it by calling ExecuteAsync(): using CliWrap To build a command, start by calling Cli.Wrap(.) with the executable path, and then use the provided fluent interface to configure arguments, working directory, or other options. Similarly to a shell, CliWrap's base unit of work is a command - an object that encapsulates instructions for running a process.
0 Comments
Leave a Reply. |