function fn-GetLineCount ($FilePath){ $nlines = 0; gc $FilePath -read 1000 | % { $nlines += $_.Length }; [string]::Format("{0} has {1} lines", $FilePath, $nlines)}
使用例子:
fn-GetLineCount "C:output.csv"