To get a list of the version and build number of all ESX hosts on a vCenter Server from PowerShell, you can use the following two commands.

getview ViewType HostSystem -Property Name,Config.Product | select Name,{$_.Config.Product.FullName}
getview ViewType HostSystem -Property Name,Config.Product | foreach {$_.Name, $_.Config.Product}

The first command produces output like this:

Name                                 $_.Config.Product.FullName
----                                 --------------------------
host1                                VMware ESX 4.0.0 build-164009
host2                                VMware ESX 4.0.0 build-164009
...                                  ...

The second will provide additional host properties and look like this:

hostname1
Name                  : VMware ESX
FullName              : VMware ESX 4.0.0 build-164009
Vendor                : VMware, Inc.
Version               : 4.0.0
Build                 : 164009
LocaleVersion         : INTL
LocaleBuild           : 000
OsType                : vmnix-x86
ProductLineId         : esx
ApiType               : HostAgent
ApiVersion            : 4.0
InstanceUuid          :
LicenseProductName    : VMware ESX Server
LicenseProductVersion : 4.0
DynamicType           :
DynamicProperty       :

hostname2
...

These use the following vSphere property hierarchy:
HostSystem has the property ‘config’ of type HostConfigInfo, which has the property ‘product’ of type AboutInfo, which has the ‘fullName’,’build’, and ‘version’ properties of the ESX host.