This is an information that many customers have been asking for (including myself) and I am super happy to share it with all.

One of our ESXi servers had purple screened and we wanted to quickly see what VMs on the host machine had been affected. 

Almost immediately, HA (High Availability) had kicked in and restarted all the VMs on different hosts. 

Get-VIEvent -MaxSamples 100000 -Start (Get-Date).AddDays(-1) -Type Warning | Where {$_.FullFormattedMessage -match “restarted”} |select CreatedTime,FullFormattedMessage | sort CreatedTime –Descending

This single PowerShell line grabbed warning events from the past 24 hours and matched the word “restarted” in them and displayed in a nice list format.  With this list in hand, we could quickly start spot checking the VMs