Hello, I would like to get date, time and hostname for each event in this script,
$report = @() $eventMgr = Get-View EventManager $events = foreach($event in $eventMgr.Description.EventInfo){ New-Object PSOBject -Property @{ Key = $event.Key Category = $event.Category EventTypeId = &{ If('ExtendedEvent','EventEx' -contains $event.Key){ $event.FullFormat.Split('|')[0] } else{ $null}} Description = $event.Description } } $events | Export-Csv C:\Users\gemela\Desktop\events.csv -NoTypeInformation -UseCulture
Thanks