VMware Cloud Community
harkamal
Expert
Expert
Jump to solution

using Get-VIew -filter

How can i search a host using its MoRef, below code does not work:

Get-View -viewtype HostSystem -Filter @ {"HostId"="Host-139"}

0 Kudos
21 Replies
LucD
Leadership
Leadership
Jump to solution

Ok, I see waht you mean and I agree that this is not a bug but my bad interpretation of the -Filter parameter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
harkamal
Expert
Expert
Jump to solution

Thanks Yavor,

Is it possible to get sub view in 1 query i.e

$host = get-view -viewtype hostsystem -property runtime, configmanager.storagesystem

$ds = get-view $host[0].configmanager.storagesystem

can i get storagesystem view in 1 shot ?

0 Kudos