You need to connect directly to Measure-Object :
Get-Content c:\serverlist.txt | Measure-Object -Character
Otherwise you will have to do either
| ForEach-Object { $_ | Measure-Object -Character }
which will be a little weird using a conveyor belt or
| ForEach-Object { Measure-Object -Character -InputObject $_ }
which will be about the same as the option above.
source share