-
Notifications
You must be signed in to change notification settings - Fork 81
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
Get-EC2Tag cmdlet does not honor ErrorAction cmdlet parameter #327
Comments
Hi GingerSnap-xx, Thanks for sharing this issue. Is this the code that I should use to reproduce this issue?
Please share the precise error message that you are receiving and trying to ignore. I should not assume that we are getting the same error message when I reproduce your steps. When I executed this command with permissions set to explicitly deny all access, I received this error message:
|
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
I’m on holiday for a week. I’ll reply when I get back.
…On Wed, Jul 26, 2023 at 18:14 github-actions[bot] ***@***.***> wrote:
This issue has not received a response in 5 days. If you want to keep this
issue open, please just leave a comment below and auto-close will be
canceled.
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOPDOKVWOSVCARPM5SGRFLXSGXHZANCNFSM6AAAAAAZ7DN53Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This is also an issue with: Example error that doesn't honor the -ErrorAction parameter - if there is no billing contact set:
Less ideal workaround, set $ErrorActionPreference to be what you want temporarily:
|
Hi Doug, This behavior is expected. It honors the precedent set by PowerShell. The error that you have shared is a terminating error. The common parameter
|
Happy to raise a new issue so as not to sidetrack this one but my question is then: Why is this a terminating error? Most PowerShell "Get" verb cmdlets don't throw terminating errors on "not found" type errors. E.g.:
All of the above return non-terminating errors. I would expect a non-terminating error and a $null return value. |
@dbaileyut Changing the current behavior would be a breaking change. As you suggested, feel free to open a new issue labeled as |
@GingerSnap-xx Please review the issue, there is a separate feature request #331 opened for team to review. Kindly confirm if it is fine to close this issue. |
Yes that other issue seems to cover the problem
…On Fri, Aug 25, 2023 at 11:37 Ashish Dhingra ***@***.***> wrote:
@GingerSnap-xx <https://github.com/GingerSnap-xx> Please review the
issue, there is a separate feature request #331
<#331> opened for
team to review. Kindly confirm if it is fine to close this issue.
—
Reply to this email directly, view it on GitHub
<#327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOPDONFGW755WQZHR5BEDTXXDIC3ANCNFSM6AAAAAAZ7DN53Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Describe the bug
GET-EC2TAG v 4.1.323 cmdlet does not honor ErrorAction parameter.
While writing an ebextension that calls Get-EC2Tag, it was deemed desirable to not write the error output to the logs as its not a problem if it cannot get the tags.
We tried making use of the ErrorAction cmdlet property and it does not suppress the error message.
Per the docs: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.3
It should suppress error messages when using Ignore.
Expected Behavior
Errors in Get-EC2Tag cmdlet should suppress error messages based on the ErrorAction variable.
Current Behavior
Errors in Get-EC2Tag cmdlet does not suppress error messages based on the ErrorAction variable.
Reproduction Steps
Call Get-EC2Tag in such a way that it produces an error (lack of authorization is our current example)
Error should be printed to console
Call Get-EC2Tag in the same way, but with -ErrorAction Ignore
Observe output
Possible Solution
Make the Get-EC2Tag cmdlet supress error messages based on ErrorAction cmdlet parameter
Additional Information/Context
No response
AWS Tools for PowerShell version used
4.1.323
PowerShell version used
5.1.17763
Operating System and version
Windows 2019 DataCenter
The text was updated successfully, but these errors were encountered: