Pipeline.InvokeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invoke the pipeline asynchronously.
public:
abstract void InvokeAsync();
public:
abstract void InvokeAsync();
abstract void InvokeAsync();
public abstract void InvokeAsync ();
abstract member InvokeAsync : unit -> unit
Public MustOverride Sub InvokeAsync ()
Exceptions
- A pipeline is already executing. Pipeline cannot execute concurrently.
- InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously.
PipelineState is not NotStarted.
RunspaceState is not Open
Pipeline already disposed
Remarks
1) Results are returned through the Output reader. 2) When pipeline is invoked using InvokeAsync, invocation doesn't finish until Input to pipeline is closed. Caller of InvokeAsync must close the input pipe after all input has been written to input pipe. Input pipe is closed by calling Pipeline.Input.Close();
If you want this pipeline to execute as a standalone command (that is, using command-line parameters only), be sure to call Pipeline.Input.Close() before calling InvokeAsync(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason.