I have a bunch of harddisk objects such as obtained by
get-vm | get-harddisk
Once I have the harddisk object in the pipeline, how can I go up and get the vcenter name as a great-great-great grandparent object?
Try like this
Get-VM | Get-HardDisk |
Select @{N="VM";E={$_.Parent.Name}},
Name,
@{N="vCenter";E={$_.Uid.Split('@')[1].Split(':')[0]}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VM | Get-HardDisk |
Select @{N="VM";E={$_.Parent.Name}},
Name,
@{N="vCenter";E={$_.Uid.Split('@')[1].Split(':')[0]}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok great thanks again.