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

Select properties to display

$
0
0

Please see the following command output:

PS C:\> Get-EC2Instance i-8c80f27a | %{ $_.RunningInstance } | Select-Object *

Tag                   : {Landscape, Test}
AmiLaunchIndex        : 0
Architecture          : x86_64
BlockDeviceMappings   : {/dev/xvda}
ClientToken           : OJzlX1431303996013
EbsOptimized          : False
Hypervisor            : xen
IamInstanceProfile    :
ImageId               : ami-e7527ed7
InstanceId            : i-8c80f27a
Tags                  : {Landscape, Test}
VirtualizationType    : hvm

 

PS C:\> Get-EC2Instance i-8c80f27a | %{ $_.RunningInstance } | Select-Object -expandproperty tags

Key                                                         Value
---                                                         -----
Landscape                                               landscape123
Test                                                        test123

 

How should I write the command to output the following:

ImageId                   Key                                      Value
---------                   ---                                        -----
ami-e7527ed7          Landscape                             landscape123


Viewing all articles
Browse latest Browse all 6937

Trending Articles