Get-View
This cmdlet returns the vSphere View objects that correspond to the specified search criteria. The cmdlet retrieves the vSphere View objects specified by their IDs or by their corresponding vSphere inventory objects (VIObject). A View object ID is a
Syntax
[-Property <String[]>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
VIObject[] | named |
|
Specifies the vSphere managed object that corresponds to the View object you want to retrieve. When you pass VIServer, Get-View returns ServiceInstance. When the retrieved View object is a ServiceInstance, you cannot convert it to a VIObject with Get-VIObjectByVIView. | optional |
|
String[] | named |
|
Specifies the properties of the view object you want to retrieve. If no value is given, all properties are shown. |
[-Filter <Hashtable>]
[-Property <String[]>]
[-SearchRoot <ManagedObjectReference>]
[-Server <VIServer[]>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
Type | named |
|
Specifies the type of the View objects you want to retrieve. This parameter accepts ClusterComputeResource, ComputeResource, Datacenter,Datastore, DistributedVirtualPortgroup, DistributedVirtualSwitch, Folder, HostSystem, Network, OpaqueNetwork, ResourcePool,StoragePod, VirtualApp, VirtualMachine, and VmwareDistributedVirtualSwitch values. | optional |
|
Hashtable | named |
|
Specifies a hash of |
optional |
|
String[] | named |
|
Specifies the properties of the view object you want to retrieve. If no value is given, all properties are shown. | optional |
|
ManagedObjectReference | named |
|
Specifies a starting point for the search (in the context of the inventory). | optional |
|
VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
ManagedObjectReference[] | named |
|
Specifies the IDs of the View objects you want to retrieve. A view object ID is a |
optional |
|
String[] | named |
|
Specifies the properties of the view object you want to retrieve. If no value is given, all properties are shown. | optional |
|
VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
ViewBaseMirroredObject[] | named |
|
Specifies view-related objects to retrieve their views. | optional |
|
String[] | named |
|
Specifies the properties of the view object you want to retrieve. If no value is given, all properties are shown. |
Output
VMware.Vim.ViewBase
Examples
Example 1
Gets the VM virtual machine using a filter by name, populates the view object and retrieves the runtime information.
Example 2
Gets the view objects of virtual machines by specifying the root folder - MoRef.
Example 3
Gets the view of a folder by specifying for the Property parameter a property path, which leads to the networks of the virtual machines in the specified folder. Retrieves the first of the returned networks.
Example 4
Gets the view of a vSphere object related to the specified Cloud object. In this case, gets the vSphere port group for the cloud external network.
Related Commands