Featured Post

A Blog Post About Nothing: Part 4 – The Circle of Trust

Have you ever felt like the world was moving at the speed of light, yet you were just doing your own thing?  That’s how I’ve felt lately.  It seems everyone has tons of stuff to talk about on their blogs and Twitter.  I decided I was going to force myself to write a blog article this morning to...

Read More

PowerShell – Speak Number of Lines of Code

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

0

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!