August 15th, 2015

PowerTip: Get Latest Entry from Event Log with PowerShell

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to get the latest entry from an event log.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see the most recent entry from the application log?

Hey, Scripting Guy! Answer Use the Get-EventLog cmdlet, specify the log name, and use the –Newest 1 parameter, for example:

Get-EventLog application -Newest 1

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback