If you have worked with vSphere, chances are you have had to perform some tasks on an ESXi host using ESXCLI. This command line interface created by VMware enables you to perform such tasks as installing software, configuring NIC adapters or seting firewall rules on ESXi. Since ESXi runs only Linux, using ESXCLI can be a bit daunting for Windows admins who don’t have much experience with Linux. Luckily, if you know PowerShell, you can use PowerCLI as a door into ESXCLI.
Connecting to an ESXi host
Connect-VIServer -Server devhost -Credential (Get-Credential)
Exposing ESX CLI
$DevHost = Get-EsxCli -VMHost devhost -V2
Notice I used the –V2 parameter. This means we are using version 2 of this cmdlet as version 1 is deprecated and compatibility is not guaranteed.
Now if we just run the output of $DevHost we see the "elements" we have to work with for this ESXi host.
Read more on Toms's IT Pro