Showing posts with label CHKDSK. Show all posts
Showing posts with label CHKDSK. Show all posts

Thursday, March 15, 2012

Using PowerShell to retreive CHKDSK log (Windows 7)

To easily check the latest CHKDSK log, enter this command into Windows PowerShell:

Get-EventLog -LogName Application -Source wininit | Select-Object -Last 1 -ExpandProperty message

This command will query the Application log with any entry whose source is "wininit" and then those objects are piped to select and expand only the "Message" property of the most recent entry.
Please note that the command above is a "one-liner" (no line break).

NOTE:  I have only tried this on Windows 7 OS