I would like to have a cmdlet to execute commands on the ESXi itself and get the Output. I'm aware of the PoshSSH, but I don't like to start the SSH service, disable lockdown, pass the credentials and do all the other stuff needed each time.
Wouldn't It be nice to have something like this: New-VMHostCMD -vmhost myESX -cmd "vmkping 192.168.1.1"?
VMware is gradually moving away from CLIs on the hosts in favor of REST APIs
The primary driver for this Idea was, that I need to execute a command like this:
/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -l -i vmhba1/qlogic
Locally.
I look forward to do this through a REST API soon. Thank you.
To Luc's point, for whatever host command line tasks may not be available through esxcli (and thus available thru Get-EsxCli), I'd rather see efforts directed at making those functions available in the APIs so they can be consumed "properly" by PowerCLI rather than a generic command interpreter for the host shell, which could introduce all kinds of opportunity for misuse.
ESXCLi is the way forward. I almost get all the work done by $esxcli = Get-ESXCLi
I think the example you are giving is not the best one, since that functionality is available through esxcli, and hence also throug Get-EsxCli ($esxcli.network.diag.ping).
Perhaps this should sooner go in the direction of extending the esxcli/Get-EsxCli cmd/cmdlet?