Featured Post

Downed trees and a revived blog

I talked to a couple of friends this past week that I haven’t talked to in awhile and they were like, how come you haven’t updated your blog? The reason is I have been EXTREMELY busy. If I have any free time where I don’t want to look at a computer I am outside working in the yard trying...

Read More


PowerShell – Speak Number of Lines of Code

Posted by Keith Elder | Posted in PowerShell | Posted on 26-02-2010

Ok, this is a total trivial post using PowerShell but it just shows some of the crazy fun things one can do with PowerShell.  Here is what this does. It uses the speech APIs in Windows to speak the number of lines of code found in a folder.

$speak = new-object -com “SAPI.SPVOICE”
$x = (dir -Include *.cs, *.aspx -Recurse | Select-String .).Count
$speak.Speak($x)

Of course if you just want the number of lines of code then just run the line in the middle.  But you have to admit, it isn’t near as fun!

NOTE: I am no PowerShell expert, please use the above code at your own risk!