Powershell: Count your Code lines

Powershell Header

After Coding some lines in a lot of different files you wanna know how much lines you have coded. There are two (I am sure there are even more) ways to do that. The first one is to get the content of the files (Get-Content) and count the lines in there.

The other way and the fasterway is with Select-String:

(Get-ChildItem -Include *.ps1 -Recurse | Select-String -pattern .).Count

Related Posts:

One thought on “Powershell: Count your Code lines

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>