Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Modify powershell output

$
0
0

Hi

My command that does the following.

PS C:\> Get-EC2Instance |%{ $_.RunningInstance } | Select-Object InstanceId,ImageID,@{Name='TagValues'; Expression={($_.
Tags |%{ $_.Value }) }}

InstanceId                              ImageId                                 TagValues
----------                              -------                                 ---------
i-230151d5                              ami-20224b10                            Scott
i-8c80f27a                              ami-e7527ed7                            {landscape123, test123}
i-3d3195cb                              ami-0b5f073b                            temp
i-a2f216ad                              ami-0b5f073b                            RHQantas
i-1a594c16                              ami-dfc39aef                            AWSBeau

The problem I have is I only want the records with attribute "landscape*" populated (see below output), how can it be done?

InstanceId                              ImageId                                 TagValues
----------                              -------                                 ---------
i-8c80f27a                              ami-e7527ed7                            landscape123
i-8c32552a                              ami-e7527ed7                            landscape555

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles