-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powershell errors #2
Comments
Thanks for the issue. Please post a small snippet of what you're trying to do. I suspect errors and warnings will be easier than confirmation messages. Thanks |
When executing a Powershell command it can provide standard output, error or warning. When using edge-ps, we have "result" as standard output however I don't know how to find out if the command did run properly when there is no output from Powershell command or error / warning was present. I know that we can use errorvariable or warningwariable in order to catch them in Powershell, however how to pass them back to nodejs ? Only way I can think of is catching -ev -we -ov into separate variables then creating a powershell object which would have result, error, warning, then convert this object into json string and pass it as "result". However this is such a long way to do it I hope that there is a better one. My example:
It's still not catching all errors :-( for example following error is not going to be "saved" into errorvariable
|
Thanks for the issue. I haven't layered in pushing errors back to node. Let me know if you'd want to take a crack at that. |
I have a similar problem: if i write some syntax error on the powershell text, i have no indication of the error when back on Node. Any advance on this ? |
The C# that handles the PowerShell engine and runspace does not handle returning errors from the pipeline etc. That needs to be extended. |
How to catch errors,warnings, confirmation messages from powershell commands ?
The text was updated successfully, but these errors were encountered: