Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,32 @@ protected void OnExited(object sender, EventArgs e)
//
stdInWriter.StopWriting();
}
PSRemotingTransportException psrte = new PSRemotingTransportException(PSRemotingErrorId.IPCServerProcessExited,
RemotingErrorIdStrings.IPCServerProcessExited);

// Try to get details about why the process exited
// and if they're not available, give information as to why
string processDiagnosticMessage;
try
{
var jobProcess = (Process)sender;
processDiagnosticMessage = StringUtil.Format(
RemotingErrorIdStrings.ProcessExitInfo,
jobProcess.ExitCode,
jobProcess.StandardOutput.ReadToEnd(),
jobProcess.StandardError.ReadToEnd());
}
catch (Exception exception)
{
processDiagnosticMessage = StringUtil.Format(
RemotingErrorIdStrings.ProcessInfoNotRecoverable,
exception.Message);
}

string exitErrorMsg = StringUtil.Format(
RemotingErrorIdStrings.IPCServerProcessExited,
processDiagnosticMessage);
var psrte = new PSRemotingTransportException(
PSRemotingErrorId.IPCServerProcessExited,
exitErrorMsg);
RaiseErrorHandler(new TransportErrorOccuredEventArgs(psrte, transportMethod));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ Do you want to continue?</value>
<value>The background process reported an error with the following message: {0}.</value>
</data>
<data name="IPCServerProcessExited" xml:space="preserve">
<value>The background process closed or ended abnormally.</value>
<value>The background process closed or ended abnormally: {0}.</value>
</data>
<data name="IPCErrorProcessingServerData" xml:space="preserve">
<value>There is an error processing data from the background process. Error reported: {0}.</value>
Expand Down Expand Up @@ -1657,4 +1657,14 @@ All WinRM sessions connected to PowerShell session configurations, such as Micro
<data name="WSManClientDllNotAvailable" xml:space="preserve">
<value>This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.</value>
</data>
<data name="ProcessExitInfo" xml:space="preserve">
<value>
Exit code: {0}
Stdout: '{1}'
Stderr: '{2}'
</value>
</data>
<data name="ProcessInfoNotRecoverable" xml:space="preserve">
<value>Information about the process could not be read: '{0}'.</value>
</data>
</root>