Иво Недев
Иво Недев

Reputation: 1590

Does this PowerShell code count empty lines when executed

I'm trying to count the lines of code in my project. It's on a remote server, so I can't exactly install software, I can but it's not that easy and it's not worth the trouble. Trying to count my lines of code I found this piece of code that works and spits out a number.

My questions is, does

(dir -r -include   *.cs,*.html | select-string . ).count

count empty lines when executed in the root project folder, or just those with anything on them ?

Upvotes: 0

Views: 441

Answers (1)

Mathias R. Jessen
Mathias R. Jessen

Reputation: 174730

No

Your regex pattern: ., will match any 1 character, but a truly empty line has exactly 0 characters, so the answer is no.

Upvotes: 1

Related Questions