-
Notifications
You must be signed in to change notification settings - Fork 23
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
Error handling #336
Comments
hey @mato, we are going to add an action item to investigate this. Could you supply us with some reproduction steps to get us up and running quicker? Thanks. |
@jordanbreen28 So, I started writing a long response with examples, but then re-checked my assumptions and I think this might just be the Exchange Online Powershell module's fault and not that of ruby-pwsh. See below. This is all with Ruby 3.1.2p20, PowerShell LTS 7.4.5 installed as a Debian package from Microsoft's site. YMMV. You need to have access to an Exchange Online instance to reproduce this. Assuming you've successfully authenticated by calling the
Compare with the same in an interactive PowerShell session:
What you can't see above is that in the interactive session case, the error message from Add-DistributionGroupMember is in red, so I originally assumed that means it goes to stderr, and was expecting to see it there in the ruby-pwsh case. Now it seems that is not actually the case? Further checking both |
This may not be a bug, I'm not a Powershell expert, but I don't know where else to ask:
Is there a way to reliably ensure that I get a clear indication on the Ruby side, when the Powershell command invoked by
execute()
results in an error or exception?Trivial example:
I'd expect to get at least an
:exitcode
of1
, or any of:errormessage
,:stderr
populated. Instead, I get nothing, and the error text just shows up in:stdout
.If type
errorerrorerror
into an interactivepwsh
session on Linux, then the error message is in red, so I'm assuming that Powershell "knows" it's an error?Context: I'm trying to automate a bunch of Exchange maintenance using the EXOv3 Powershell module, but driving "what needs to be done" from a Ruby script, which connects to a bunch of other systems. If I get my EXOv3 invocations wrong, I get no indication on the Ruby side that the command(s) failed.
The text was updated successfully, but these errors were encountered: