Skip to content

Get-EC2Tag cmdlet does not honor ErrorAction cmdlet parameter #327

Closed
@GingerSnap-xx

Description

@GingerSnap-xx

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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.module/powershell-cmdletsneeds-reviewp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions