PowerCLI last patch date script to get VIB install date
· ☕ 1 min read · 🤖 Javy de Koning
PowerCLI last patch date You might find yourself wanting a report of when your vSphere servers have been patched for the last time. Here you will find a simple PowerCLI script that uses vSphere CLI to query the last VIB install date.
PowerCLI script: Get-VMHost | ForEach-Object -Process { [PSCustomObject]@{ 'lastpatchdate' = [datetime]((Get-ESXCli -VMHost $_).software.vib.list() | Select-Object -Property installdate -ExpandProperty installdate | Sort-Object -Descending)[0] 'host' = $_.Name 'version' = $_.version 'build' = $_.