It’s been a while since I needed to update a VIB because VUM does a great job for upgrades/updates. Again, (for all my blog posts) you can reduce the code but I’m leaving it bloated so folks see the action lines and can edit/add as needed.

*** BIG gotcha with the script below. If you would like to loop through all hosts in a cluster, you will need to upload the VIB to a datastore that all the hosts can see/access. If you do not have shared storage, you can run the script serially (without the foreach loop) and edit the $vibpath var for each host.

#Update all hosts!
foreach($a in (get-vmhost | sort name)){
$vibpath = "/vmfs/volumes/datastore/YourNewVIB.vib"
$q = get-esxcli -vmhost $a
$dowork = $q.software.vib.install($null,$null,$null,$null,$null,$true,$null,$null,$vibpath)
$a.name
$dowork
}

## OR update a single esxi host
$vibpath = "/vmfs/volumes/datastore/YourNewVIB.vib"
$q = get-esxcli -vmhost "YourHostName"
$dowork = $q.software.vib.install($null,$null,$null,$null,$null,$true,$null,$null,$vibpath) 
$dowork

$a (in the foreach loop) will dump the hostname and $dowork will dump the 'success' message for the VIB install.

If you want to simply run a report for VIB version, run the following (Edit the ‘*ism*’ text below to match the string in the VIB you are looking for)

$report = @()
foreach($a in (get-vmhost | sort name)){
$q = get-esxcli -vmhost $a
$row = “” | select hostname,vib,version
$z = $q.software.vib.list() | where {$_.ID -like “*ism*”}
$row.hostname = $a
$row.vib = $z.id
$row.version = $z.version
$report += $row
}
$report