-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
When a terminating error is thrown from the script, PowerShell.EndInvoke(IAsyncResult) will throw the exception and there is no way to get the partial results back (output from before the terminating error).
It would be good to make it able to return the partial results when a terminating error is thrown.
Steps to reproduce
$ps = [powershell]::Create()
$ps.AddScript("'Hello World'; gcm blah -ea stop; 'yeah'") > $null
$a = $ps.BeginInvoke()
$b = $Ps.EndInvoke($a)Expected behavior
Throw the exception, but at the same time allow the users to get the partial results back.
Actual behavior
Exception is thrown, $b is null, and the partial output is lost.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime