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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With