In the documentation, the Tag property is a list of Tag objects. Thus, in general, several keys / values will be stored there. Do you assume that in your case there is only 1?
Select-Object allows you to capture not only raw property values, but also computed values. Say you just want a comma-separated list of Value objects from Tag objects in the list. Here's how you do it:
$instances = Get-EC2Instance ` |%{ $_.RunningInstance } ` | Select-Object InstanceId,PublicDnsName,@{Name='TagValues'; Expression={($_.Tag |%{ $_.Value }) -join ','}}
$instances TagValues elements will now have the TagValues property, which is a string consisting of Value from all the tags associated with the instance.
source share