diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 3829634c8c8..850d3e1116e 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -3079,6 +3079,10 @@ public IAsyncResult BeginInvoke(PSDataCollection input, /// /// Object is disposed. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// public Task> InvokeAsync() => Task>.Factory.FromAsync(BeginInvoke(), _endInvokeMethod); @@ -3120,6 +3124,10 @@ public Task> InvokeAsync() /// /// Object is disposed. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// public Task> InvokeAsync(PSDataCollection input) => Task>.Factory.FromAsync(BeginInvoke(input), _endInvokeMethod); @@ -3174,6 +3182,10 @@ public Task> InvokeAsync(PSDataCollection input /// /// Object is disposed. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// public Task> InvokeAsync(PSDataCollection input, PSInvocationSettings settings, AsyncCallback callback, object state) => Task>.Factory.FromAsync(BeginInvoke(input, settings, callback, state), _endInvokeMethod); @@ -3222,6 +3234,14 @@ public Task> InvokeAsync(PSDataCollection input /// /// Object is disposed. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// To collect partial output in this scenario, + /// supply a for the parameter, + /// and either add a handler for the event + /// or catch the exception and enumerate the object supplied for . + /// public Task> InvokeAsync(PSDataCollection input, PSDataCollection output) => Task>.Factory.FromAsync(BeginInvoke(input, output), _endInvokeMethod); @@ -3284,6 +3304,14 @@ public Task> InvokeAsync(PSDataColle /// /// Object is disposed. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// To collect partial output in this scenario, + /// supply a for the parameter, + /// and either add a handler for the event + /// or catch the exception and use object supplied for . + /// public Task> InvokeAsync(PSDataCollection input, PSDataCollection output, PSInvocationSettings settings, AsyncCallback callback, object state) => Task>.Factory.FromAsync(BeginInvoke(input, output, settings, callback, state), _endInvokeMethod); @@ -3655,6 +3683,14 @@ private void AppendExceptionToErrorStream(Exception e) /// asyncResult object was not created by calling BeginInvoke /// on this PowerShell instance. /// + /// + /// The running PowerShell pipeline was stopped. + /// This occurs when or is called. + /// To collect partial output in this scenario, + /// supply a to for the parameter + /// and either add a handler for the event + /// or catch the exception and enumerate the object supplied. + /// public PSDataCollection EndInvoke(IAsyncResult asyncResult) { try @@ -3706,6 +3742,10 @@ public PSDataCollection EndInvoke(IAsyncResult asyncResult) /// /// Object is disposed. /// + /// + /// When used with , that call will return a partial result. + /// When used with , that call will throw a . + /// public void Stop() { try @@ -3762,6 +3802,10 @@ public IAsyncResult BeginStop(AsyncCallback callback, object state) /// asyncResult object was not created by calling BeginStop /// on this PowerShell instance. /// + /// + /// When used with , that call will return a partial result. + /// When used with , that call will throw a . + /// public void EndStop(IAsyncResult asyncResult) { if (asyncResult == null) @@ -3812,6 +3856,10 @@ public void EndStop(IAsyncResult asyncResult) /// /// Object is disposed. /// + /// + /// When used with , that call will return a partial result. + /// When used with , that call will throw a . + /// public Task StopAsync(AsyncCallback callback, object state) => Task.Factory.FromAsync(BeginStop(callback, state), _endStopMethod);