PowerShell.BeginInvoke<TInput, TOutput> Method (PSDataCollection<TInput>, PSDataCollection<TOutput>, PSInvocationSettings, AsyncCallback, Object)
Updated: April 27, 2016
Applies To: Windows PowerShell
Asynchronously runs the commands of the PowerShell object pipeline by using a specified input buffer, invocation settings, callback method, and output buffer. This method is introduced in Windows PowerShell 2.0.
Assembly: System.Management.Automation (in System.Management.Automation.dll)
public IAsyncResult BeginInvoke<TInput, TOutput>( PSDataCollection<TInput> input, PSDataCollection<TOutput> output, PSInvocationSettings settings, AsyncCallback callback, object state )
A PSDataCollection<T> of type parameter TInput that contains input data for the first command of the pipeline.
A PSDataCollection<T> of type parameter TOutput that contains the output of the pipeline.
A PSInvocationSettings object that specifies Windows PowerShell defined options used when invoking the commands, such as which host should be used when the commands are invoked.
An AsyncCallback delegate that references a call to make when the call is complete.
A user-supplied state to use when the callback method is called.
Return ValueType: System.IAsyncResult
An IAsyncResult interface that represents the status of the asynchronous operation. The EndInvoke method uses this interface to determine when to return the results of the operation to the supplied output buffer.
When this method is used, calls to the EndInvoke method return a null buffer.
The type of the objects used as input to the first command of the pipeline.
The type of the output objects expected from invoking the commands of the pipeline.
When this method is called, invocation does not begin until the application completes adding data to the buffer. The caller of the Complete after all input is written to the input buffer. If you do not call the Complete method, Windows PowerShell will continue to wait for input data and not invoke the pipeline. If you observe that the invocation is not doing anything, this might be the reason.must call