I'm trying to return 1221 events that were produced today:
Get-EventLog "Application" | where-Object {$_.EventID -eq 1221 -AND $_.lastwritetime -eq [datetime]::today} | Format-Table -autosize -wrap
This produces nothing. If I substitute "-eq [datetime]::today" with "-lt [datetime]::today" I get events from today and earlier, but I don't want earlier...
What am I doing wrong?