# take events not older than 48 hours $deadline = (Get-Date).AddHours(-48)
Get-EventLog-LogName * | ForEach-Object { # get the entries, and quiet errors try { $_.Entries } catch {} } | Where-Object { # take only errors $_.EntryType -eq'Error' } | Where-Object { # take only entries younger than the deadline $_.TimeGenerated -gt$deadline }