PowerShell makes it very easy to get information about virtual environments in very few lines of script language. Rick Vanover shows us just how easy in a recent article that details how to get the major version and install date of all your VMware ESXi hosts using PowerCLI (VMware’s PowerShell extension).
Get-VMHostPatch * | Select ID, InstallDate, VMHostID
Get-VMHost | Select ID, name
Rick states, “…the script is simple and dirty and returns the selected information in two views. The VMHostPatch cmdlet returns only the real information I want coupled with a VMHostID. That is correlated in the Get-VMHost cmdlet, which returns the DNS name of the hosts in question. What is also cool about this is that it can report against multiple vCenter connections simultaneously (as can most cmdlets, for that matter).”