Currently it takes 15-20 seconds to pull specific event viewer logs, is there a more efficient way to accomplish the same end result?
I need the last 5 minutes' worth of application logs for Instance ID 21.
Start-Transcript -Path C:\Windows\Blah\Data\Logs\Temp\StatusErrors.TXT -Append -Force -ErrorAction SilentlyContinue
Get-EventLog -LogName application -After (Get-Date).AddMinutes(-5) -InstanceID 21 -Message "*device*" | Select-Object -ExpandProperty message
Stop-Transcript