Need a way to enable CMD-like error handling - by sba

Status : 


Sign in
to vote
ID 802041 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 9/24/2013 12:36:44 AM
Access Restriction Public


When an attempt to run an EXE is made from within CMD, but this fails due to a missing DLL or missing export in a DLL (among other possible failures), a popup message is displayed that tells the interactive user the name of the missing DLL or information about the missing export.

This behavior is not desirable in scripts, so the PowerShell designers have decided not to implement it; instead the execution continues and $LASTEXITCODE is set to something like 0xC0000135.

This makes troubleshooting difficult, because from a PowerShell prompt there is (AFAIK) no way to get the information the popup would bring. There is not even an error message!

I'm a long-time user of MKS Toolkit, where this is configurable -- see the '-X' option at -- and where the shell at least tells you that the child process could not start.

Couldn't this be implemented in PowerShell (both the console host and the ISE, of course)?
Sign in to post a comment.