Table of Contents

Class CommandLineWrapper

Namespace
Cmpnnt.Pia.Ctl.Lib
Assembly
Cmpnnt.Pia.Ctl.dll

Wraps the system console, invokes the piactl executable and captures the output.

public class CommandLineWrapper : ICommandLineWrapper
Inheritance
CommandLineWrapper
Implements
Inherited Members

Methods

Execute(string, PiaCtlOptions, CancellationToken)

Invokes piactl with the specified command. Conforms to ExecuteDelegate

public Task<PiaResults> Execute(string command, PiaCtlOptions options, CancellationToken ct = default)

Parameters

command string

The CLI command to be passed to piactl

options PiaCtlOptions

The options to configure PiaCtl.

ct CancellationToken

A cancellation token.

Returns

Task<PiaResults>

A Task<PiaResults> containing standard output and standard error results.

ExecuteTimed(uint, string, PiaCtlOptions)

Invokes piactl with the specified command and keeps the it running for a given time. Unless the command errors, this method will return success when the timeout expires. Conforms to ExecuteTimedDelegate

public Task<PiaResults> ExecuteTimed(uint timeout, string command, PiaCtlOptions options)

Parameters

timeout uint

The time, in seconds, after which to cancel the task

command string

The CLI command to be passed to piactl

options PiaCtlOptions

The options to configure PiaCtl.

Returns

Task<PiaResults>

A Task<PiaResults> containing standard output and standard error results.