vSphere PowerCLI Reference

Get-EsxCli

Synopsis

This cmdlet exposes the ESXCLI functionality.

Syntax

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

Related Commands

Online version
Get-EsxTop

Detailed Description

This cmdlet exposes the ESXCLI functionality.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
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.falsetrue (ByValue)
VMHostVMHost[]Specifies hosts on which you want to expose the ESXCLI functionality.truetrue (ByValue)

Return Type

One EsxCli object per host

Notes

Supported on ESX 4.1/vCenter Server 5.0 and later.

Examples

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

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

Retrieves ESXCLI from the default ESX connection. This example works only on vCenter Server 5.0/ESXi 5.0.

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

$esxcli.storage.nmp

Gets a list of all available applications in the specified namespace. This example works only on vCenter Server 5.0/ESXi 5.0.

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

$esxcli.storage.nmp.device

Gets a list of all available commands of the specified application. This example works only on vCenter Server 5.0/ESXi 5.0.

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

$esxcli.storage.nmp.device.list($null)

Runs a command of an ESXCLI application by using the ESXCLI wrapper of PowerCLI. This example works only on vCenter Server 5.0/ESXi 5.0.

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

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

Runs a command of an ESXCLI application by using the ESXCLI wrapper of PowerCli. This example works only on vCenter Server 5.0/ESXi 5.0.

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

$esxcli.TypeManager.QueryMoInstances($null)

Gets a list of all available managed object instance descriptors. This example works only on vCenter Server 5.0/ESXi 5.0.

-------------- Example 7 --------------

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

$moTypeInfo.managedTypeInfo[0].method

Gets information about the specified managed object type (vim.EsxCLI.storage.nmp.device) and methods.

-------------- Example 8 --------------

$moInstance = $esxcli.TypeManager.CreateDynamicManagedObject("ha-cli-handler-storage-nmp-device")

Creates a dynamic managed object for the specified managed object instance descriptor. This example works only on vCenter Server 5.0/ESXi 5.0.

-------------- Example 9 --------------

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

Calls a method without specifying parameters on a dynamic managed object. This example works only on vCenter Server 5.0/ESXi 5.0.

-------------- Example 10 --------------

$moInstance.InvokeOperation("set", @{"device" = "naa.60060160b0402000f03655712a12de11"; "psp" = "VMW_PSP_MRU"})

Calls a method with parameters on a dynamic managed object. The parameters of the method are specified as a hash table. This example works only on vCenter Server 5.0/ESXi 5.0.


Copyright © VMware, Inc. All rights reserved.