vSphere PowerCLI Reference



Exposes the ESXCLI functionality.


Get-EsxCli -VMHost <VMHost[]> [[-Server] <VIServer[]>] [<CommonParameters>]

Related Commands

Online version

Detailed Description

Exposes the ESXCLI functionality.


NameTypeDescriptionRequired?Pipeline InputDefault Value
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsetrue (ByValue)
VMHostVMHost[]Specify hosts on which you want to expose the ESXCLI functionality.truetrue (ByValue)

Return Type



Supported on ESX 4.0/vCenter Server 5.0 and later.


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

$esxcli = Get-EsxCli -Server $global:DefaultVIServer

Retrieve ESXCLI from the default ESX connection.

-------------- Example 2 --------------


Invoke a method of an ESXCLI object by using PowerClI ESXCLI wrapper and specifying $null for a non-required parameter.

-------------- Example 3 --------------

$esxcli.nmp.device.setpolicy($null, "naa.60060160b0402000f03655712a12de11", "VMW_PSP_MRU")

Invoke a method of an ESXCLI object by using PowerCLI ESXCLI wrapper and specifying values for the parameter.

-------------- Example 4 --------------


Retrieve a list of the available managed object instances (namespaces with their classes).

-------------- Example 5 --------------

$moTypeInfo = $esxcli.TypeManager.QueryTypeInfo("vim.EsxCLI.nmp.device")

Retrieve information for a specific managed object type (vim.EsxCLI.nmp.device).

-------------- Example 6 --------------

$moInstance.InvokeOperation("list", $null)

Invoke a method on a specific managed object instance. The first argument is the name of the method, the second one is a hash table with parameters if any - in this case $null.

Copyright © 1998 - 2011 VMware, Inc. All rights reserved.