Quantcast
Viewing latest article 1
Browse Latest Browse All 2

PowerShell – Speak Number of Lines of Code

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!


Viewing latest article 1
Browse Latest Browse All 2

Trending Articles