What are the valid Get-View ViewTypes?

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.