-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Summary of the new feature / enhancement
I updated a module to use v1.1 and handle errors using Pop-CrescendoNativeError -EmitAsError.
The command-line tool quser.exe sends two error messages when a remote machine cannot be reached so this puts two messages in the __CrescendoNativeErrorQueue.
When using the -ErrorAction Stop parameter on the function it will trigger on the first error as expected. However the second message is still in the ErrorQueue. The next time the command is run, it will spit out that remaining error message even if the command is succesful.
I've tried to illustrate the behaviour in the screenshots.


Proposed technical implementation details (optional)
It's open for discussion on whether this is an issue that needs to be solved or if the onus is on us to make changes according to our needs for the module.
Right now, to solve the problem I tweaked the function Pop-CrescendoNativeError to group multiple messages into 1 and write the errormessage only when the CrescendoNativeErrorQueue is empty.