Hi fellow experts,
How can I get a specific sets of VMhost from a specific Data center when using Get-View?
Get-View -ViewType HostSystem -PipelineVariable esx
Because it does not take any pipeline input: Get-DataCenter | Where {$_.Name -like '*-PROD-*'} | Get-View ....
Thank you in advance.
You can use the SearchRoot parameter, point to the MoRef of the Datacenter
$dc = Get-Datacenter -Name MyDC
Get-View -ViewType HostSystem -SearchRoot $dc.ExtensionData.Moref
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can use the SearchRoot parameter, point to the MoRef of the Datacenter
$dc = Get-Datacenter -Name MyDC
Get-View -ViewType HostSystem -SearchRoot $dc.ExtensionData.Moref
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The Filter parameter is also described in the Get-View online documentation.
But be aware the right-hand operator is a RegEx expression.
You should be able to find examples when you do a Search in here on Get-View and Filter
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference