powershell start process not showing error

Miroslaw Dobrzanski-Neumann 1 Reputation point
2022-11-11T23:59:22.85+00:00

Hello,
maybe someone could help here

when attempting to execute a process from cmd.exe/comand prompt where a required dll is missing one gets an error window of what went wrong (abc.dll not found)

How to convince powershell to give similar diagnostics instead of perfect silence

that is when doing the following I'd like to get at least a response
$> &xyz.exe
xyz.exe failed to start because abc.dll was not found

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2022-11-12T03:16:49.787+00:00

    The cmd.exe shell (being a textual shell) would not have used an "error window" to report an error. That would be the work of the executable "xyz.exe".

    I'm not clear about the $> &xyz.exe in you description. First, that looks like a DOS prompt, not a PowerShell prompt. Second, the ampersand in PowerShell is a "call operator" and runs the "thing" in a child scope, so once "xyz.exe" ends the results are gone. Provided xyz.exe is in your PATH directories you should be able to run is simply by entering "xyz.exe".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.