powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-EsxCli



NAME
Get-EsxCli

SYNOPSIS
Exposes the ESX CLI functionality.

SYNTAX
Get-EsxCli -VMHost [[-Server] ] []


DESCRIPTION
Exposes the ESX CLI functionality.


PARAMETERS
-VMHost
Specify hosts on which you want to expose the ESXCLI functionality.

Required? true
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
EsxCli


NOTES


Supported on ESX 4.0/vCenter Server 5.0 and later.

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

C:\PS>$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 --------------

C:\PS>$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 --------------

C:\PS>$esxcli.storage.nmp.device


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





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

C:\PS>$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 vCente
r Server 5.0/ESXi 5.0.





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

C:\PS>$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 --------------

C:\PS>$esxcli.TypeManager.QueryMoInstances($null)


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





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

C:\PS>$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 --------------

C:\PS>$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 v
Center Server 5.0/ESXi 5.0.





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

C:\PS>$moInstance.InvokeOperation("list", $null)


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





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

C:\PS>$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 ta
ble. This example works only on vCenter Server 5.0/ESXi 5.0.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-EsxCli.html
Get-EsxTop