hi
how do I join these 2 together ? I am trying to get output of my vms
NAme, OS version, hard disk1, hard disk2
so I have
get-vm | select Name, @{N="OS"; e={$_.Extensiondata.Guest.GuestFullName}}, @{N="IP Address";E={@($_.guest.IPAddress[0])}}
but I also want
get-vm | get-harddisk | select CapacityGB
Can I combine both in one line and output hard disk1 and 2 in separate columns?
Thank you
Try like this, the VirtualMachine object is available under the Parent property
Get-VM | Get-Harddisk | Select-Object -Property Name,CapacityGB,
@{N='VM';E={$_.Parent.Name}},
@{N = 'OS';E = {$_.Parent.Extensiondata.Guest.GuestFullName}},
@{N = 'IP Address';E={@($_.Parent.guest.IPAddress[0])}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this, the VirtualMachine object is available under the Parent property
Get-VM | Get-Harddisk | Select-Object -Property Name,CapacityGB,
@{N='VM';E={$_.Parent.Name}},
@{N = 'OS';E = {$_.Parent.Extensiondata.Guest.GuestFullName}},
@{N = 'IP Address';E={@($_.Parent.guest.IPAddress[0])}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks Luc that works