In this post, I would like to introduce two other methods to execute ESXi CLI commands.
Microsoft Windows PowerShell and VMware PowerCLI are commonly used by VMware admins. The functionality of PowerShell can be extended by adding Modules. Since PowerShell version 5 adding Modules has become very easy with the introduction of repositories (external and internal). A repository is (said irreverently) a kind of app store where you can retrieve modules. The best known repository is the PowerShell Gallery. If this is all new, the link provides information to get your started, as well as many posts about this topic.
A very handy module is Posh-SSH, created by Carlos Perez, which extend PowerShell with SSH and SCP functionality. The following commands will check for the availability of the PowerShell Gallery and installs the Posh-SSH module.
PS C:\Users> Get-PSRepository Name InstallationPolicy SourceLocation ---- ------------------ -------------- PSGallery Untrusted https://www.powershellgallery.com/api/v2/
The Get-PSRepository should return the PSGallery as one of the repositories.