Whilst playing with Get-View today I could not work out what I needed as the ViewType for ESXi hosts. Since VirtualMachine is fairly self explanatory I figured it must be VMHost or just Host. Wrong. Either way the error was very helpful in letting me know what the valid options were. See below.
PS > Get-View -ViewType VMHost Get-View : Cannot validate argument on parameter 'ViewType'. Accepted types: ClusterComputeResource, ComputeResource, D atacenter, Datastore, DistributedVirtualPortgroup, DistributedVirtualSwitch, Folder, HostSystem, Network, ResourcePool, StoragePod, VirtualApp, VirtualMachine, VmwareDistributedVirtualSwitch
Accepted types (formatted nicely):
- ClusterComputeResource
- ComputeResource
- Datacenter
- Datastore
- DistributedVirtualPortgroup
- DistributedVirtualSwitch
- Folder
- HostSystem
- Network
- ResourcePool
- StoragePod
- VirtualApp
- VirtualMachine
- VmwareDistributedVirtualSwitch