PowerCLI Reference



This cmdlet converts a vSphere View object to a VIObject.


Get-VIObjectByVIView [-MORef] <ManagedObjectReference[]> [-Server <VIServer[]>] [<CommonParameters>]

Get-VIObjectByVIView [-VIView] <ViewBase[]> [<CommonParameters>]

Related Commands

Online Version

Detailed Description

This cmdlet converts a vSphere View object to a VIObject using the object ID provided by the MoRef parameter. If the View object is a ServiceInstance, you cannot convert it to a VIObject.


NameTypeDescriptionRequired?Pipeline InputDefault Value
MORefManagedObjectReference[]Specifies the managed object ID, obtained from a property of another managed object or a view.trueTrue (ByValue)
VIViewViewBase[]Specifies the vSphere .NET View object you want to convert to a VMware PowerCLI object.trueTrue (ByValue)
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no 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.falseFalse

Return Type

Zero or more VIObject objects



-------------------------- Example 1 --------------------------

$view = Get-VM VM | Stop-VM | Get-View

$vm = Get-VIObjectByVIView $view | Start-VM

Gets the VM virtual machine, stops it, and gets its view object. Then, the command gets the virtual machine object using the Get-VIObjectByVIView cmdlet and starts the VM virtual machine.

Copyright © VMware, Inc. All rights reserved.