line count in txt file

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

line count in txt file

Post by StupidSexyFlanders »

I have a two text files. One has 25 lines, the other has 1 line. Let's call them $big and $small, respectively.

This returns the correct results:
PS C:>(Get-Content $big).count
PS C:>25

But this returns no results:
PS C:>(Get-Content $small).count

Why is the single line file not being seen as such?
Mike

StupidSexyFlanders
Posts: 107
Joined: Sun Nov 27, 2011 9:22 am

line count in txt file

Post by StupidSexyFlanders »

I have a two text files. One has 25 lines, the other has 1 line. Let's call them $big and $small, respectively.

This returns the correct results:
PS C:>(Get-Content $big).count
PS C:>25

But this returns no results:
PS C:>(Get-Content $small).count

Why is the single line file not being seen as such?
Mike

Locked