Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

VMware PowerCLI esxcli namespace command elements empty no output

This article is another part and related to this VMware PowerCLI Connect-VIServer Object reference not set to an instance of an object. The resolution used in the earlier blog is applied here in this article.

The problem description is, I connected to my vCenter server after I tried to connect ESXi server with esxcli command set but sub command elements where blank empty. I wanted to install software vib using esxcli but since sub namespace commands where not available, I was not able to perform any command. This issue is due to older version of PowerCLI version trying to connect newer version of vCenter or Esxi server.

Connect-VIServer

$esxcli = Get-VMHost | Get-EsxCli
WARNING:
   The Get-EsxCli cmdlet provides a new interface to the ESXCLI functionality.
   Use the -V2 parameter to switch to the new cmdlet interface.
   Check the cmdlet help for more information.

   Scripts that use the old cmdlet interface may no be compatible across two different versions of the ESX server.
   The old cmdlet interface is deprecated and will be removed in a future version.
$esxcli
==============================
EsxCli: ironman.vcloud-lab.com

$esxcli = Get-VMHost | Get-EsxCli -V2
$esxcli
==============================
EsxCli: ironman.vcloud-lab.com

Microsoft PowerShell vmware vsphere vcenter esxi administrator.vsphere.local esxcli get-vmhost get-esxcli deprecated cmdlet vmware.powercli -v2 future commands esxi.png

To check the current installed VMware PowerCLI version and to update module on the system use below commands. This Powershell module is downloaded and installed from online Microsoft Powershell module repository psgallery. https://www.powershellgallery.com/packages/VMware.PowerCLI/

Get-PowerCLIVersion
Update-Module VMware.PowerCLI -Scope CurrentUser

Microsoft Powershell vmware vsphere vcenter server vcsa esxi Get-PowerCLIVersion cis core vimautomation update module scope currentuser vmware.powercli untrusted repository set-psrepository psgallary.png

After PowerCLI module upgrade is successful, I restarted PowerShell and logged into and connected to vCenter server / Esxi Server again, Checked latest version of PowerCLI, its upgraded successfully. Then tested esxcli command with PowerCLI. All the sub namespaces and element commands are listed and I can automate further esxi related tasks with them.

VMware vsphere vCenter ESXI esxcli Get-PowerCLIVersion Connect-VIServer daemon device fcoe graphics hardware iscsi network nvme rdma sched software storage system vm vsan powercli powershell microsoft.png

Connect-VIServer

Get-PowerCLIVersion

$esxcli = Get-VMHost | Get-EsxCli
$esxcli

==============================
EsxCli: ironman.vcloud-lab.com

   Elements:
   ---------
   daemon
   device
   esxcli
   fcoe
   graphics
   hardware
   iscsi
   network
   nvme
   rdma
   sched
   software
   storage
   system
   vm
   vsan

Useful Articles
Resolved: HP ILO this page cannot be displayed ERR_SSL_BAD_RECORD_MAC_ALERT
Reset/Restart HP ILO (Integrated Lights-outs) using putty
Reset HP ILO password from Esxi server
ESXi HP Blade start issue Enclosure power event detected, System Halted until power condition is corrected
Esxi update individual component firmware on HP hardware: disk degraded not authenticated
Resolved syslog error: Call OptionManager.UpdateValues for object ha-adv-options on ESXi failed
Solved: Esxi server cannot joined into active directory domain
Solved Esxi host disconnected evaluation license expired
Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration

Go Back

Comment

Blog Search

Page Views

6068969

Follow me on Blogarama