PowerCLI: Get ESX version info


image

If you want a quick overview of your ESX servers, you can run the following script:

$vCenter = Read-Host "Enter the vCenter server name"

Connect-VIServer $vCenter

$vmhosts = get-vmhost * 
$vmhosts | Sort Name -Descending | % { $server = $_ |get-view; `
    $server.Config.Product | select `
    @{ Name = "Server Name"; Expression ={ $server.Name }}, `
    Name, Version, Build, FullName, ApiVersion }

Disconnect-VIServer -Confirm:$false
 

The output looks like this:

image