PowerShell.BeginInvoke Method (PSDataCollection, PSInvocationSettings, AsyncCallback, Object)

Asynchronously runs the commands of the PowerShell object by using a specified input buffer for the first command of the pipeline, specified invocation options, and a specified callback method to use when the invocation is complete. This method is introduced in Windows PowerShell 2.0.

Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

Dim instance As PowerShell
Dim input As PSDataCollection(Of T)
Dim settings As PSInvocationSettings
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginInvoke(input, settings, callback, state)

public IAsyncResult BeginInvoke<T> (
	PSDataCollection<T> input,
	PSInvocationSettings settings,
	AsyncCallback callback,
	Object state



The type of the objects of the input buffer.



A PSDataCollection of type parameter T that contains the input data for the first command of the pipeline.


A PSInvocationSettings object that specifies options used when invoking the commands, such as which host should be used when the commands are invoked.


An AsyncCallback delegate that is called when the command invoked by the BeginInvoke(Generic PSDataCollection,PSInvocationSettings,AsyncCallback,Object) method is complete.


A user-supplied state to use when the callback method is called.

Return Value

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
© 2014 Microsoft