PowerShell.EndInvoke(IAsyncResult) Method

Definition

Waits for the pending asynchronous BeginInvoke to complete.

public:
 System::Management::Automation::PSDataCollection<System::Management::Automation::PSObject ^> ^ EndInvoke(IAsyncResult ^ asyncResult);
public System.Management.Automation.PSDataCollection<System.Management.Automation.PSObject> EndInvoke (IAsyncResult asyncResult);
member this.EndInvoke : IAsyncResult -> System.Management.Automation.PSDataCollection<System.Management.Automation.PSObject>
Public Function EndInvoke (asyncResult As IAsyncResult) As PSDataCollection(Of PSObject)

Parameters

asyncResult
IAsyncResult

Instance of IAsyncResult returned by BeginInvoke.

Returns

PSDataCollection<PSObject>

The output buffer created to hold the results of the asynchronous invoke, or null if the caller provided their own buffer.

Exceptions

asyncResult is a null reference.

asyncResult object was not created by calling BeginInvoke on this PowerShell instance.

Applies to