aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
238 stars 79 forks source link

Get-CFResourceTag's output only shows Keys #29

Closed matteo-prosperi closed 1 year ago

matteo-prosperi commented 5 years ago

Because of the double level of incapsulation in Amazon.CloudFront.Model.ListTagsForResourceResponse, Get-CFResourceTag's output only shows Keys.

Possible Solution Implement a custom formatter for Amazon.CloudFront.Model.ListTagsForResourceResponse

Steps to Reproduce (for bugs) Invoke Get-CFResourceTag or

$tags = [Amazon.CloudFront.Model.Tags] @{}
$tags.Items.Add( [Amazon.CloudFront.Model.Tag] @{Key = 'k1'; Value = 'v1'} )
$tags.Items.Add( [Amazon.CloudFront.Model.Tag] @{Key = 'k2'; Value = 'v2'} )
$tags

Expected Behavior

Key Value
--- -----
k1  v1
k2  v2

Current Behavior

Items
-----
{k1, k2}

Context A workaround is available:

(Get-CFResourceTag ...).Items

or

Get-CFResourceTag ... |  Select-Object -ExpandProperty Items

show the expected list with both keys and values

ashishdhingra commented 2 years ago

We might need to write formatting file and link it to PowerShell module, reference https://docs.microsoft.com/en-us/powershell/scripting/developer/format/formatting-file-overview?view=powershell-7.1

github-actions[bot] commented 1 year ago

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.