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


"Hello World"

This is my first blog attempt, so if anyone happens to come across this blog, please bear with me as I experience this new (to me) technology vehicle.

I am a computer technician, always open to learning something new.  I have recently discovered PowerShell, and I am addicted! The most of what I plan on posting will be scripts or commands that I've learned or figured out on my own (that's the most rewarding and fun part of it!!) or of course, anything worth learning/sharing!

So I hope this will be an ongoing learning experience for myself and anyone who happens to venture this way!  Happy PowerShelling!!