Line counting in powershell

Quick Tip: If you want to do a line count on a project, a really easy way to do it is with a simple Powershell command:

(dir -include *.cs,*.xaml -recurse | select-string .).Count

Add extension types as necessary. Note that it DOES include comments in the line count.

Here’s the stackoverflow article where this originated from, I needed something that would run outside of the main solution to take into account all the additional projects and files, so a plugin was not going to work.

Leave a Reply

Your email address will not be published. Required fields are marked *