June 4th, 2014

PowerTip: Use PowerShell to See Latest Log Entry

Doctor Scripto
Scripter

Summary: Easily see the newest log entry by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly check the most recent entry from a classic event log,
          such as the application, system, or security log?

Hey, Scripting Guy! Answer Use the Get-EventLog cmdlet and specify the –newest parameter, for example:

Get-EventLog application -new 1

   Or use the Get-WinEvent cmdlet:

Get-WinEvent application -max 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.