To retrieve all error events from a system log that occurred yesterday, here is how to calculate the start and stop times:
PS> $end = Get-Date -Hour 0 -Minute 0 -Second 0 PS> $start = $end.AddDays(-1) PS> Get-EventLog -LogName System -EntryType Error -Before $end -After $start