Did you try with
Foreach ($esx in $esxhosts) {Get-VIEvent -Entity $esx -Start (Get-Date).AddHours(-1) -Finish (Get-Date) |Where {$_.GetType().Name -eq "EventEx"} |Select @{N="Time";E={$_.CreatedTime.ToUniversalTime()}}, @{N="Message";E={$_.FullFormattedMessage}} |Export-Csv c:\$esx.csv -UseCulture -NoTypeInformation}