Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell: GetEventlog, time field is empty

I'm trying to get selected objetcts from GetEventlog

$StartDay = (Get-Date).AddDays(-1)
Get-EventLog -LogName application -After $StartDay | Select-Object Time, EntryType, Source, Message

but this is producing time field as empty column with no data. How to format time field to show data?

like image 615
jrara Avatar asked Dec 22 '11 09:12

jrara


1 Answers

the property TIME not exist, you can use TIMEWRITTEN or TIMEGENERATED:

Get-EventLog -LogName application -After $StartDay | Select-Object Timegenerated, EntryType, Source, Message

Try this command to see exactly all properties:

(Get-EventLog -LogName application -After $StartDay )[0] | fl * #format-list

or

(Get-EventLog -LogName application -After $StartDay )[0] | gm #get-member
like image 200
CB. Avatar answered Sep 23 '22 19:09

CB.