Skip to content

Instantly share code, notes, and snippets.

@JhonAlx
Created February 1, 2016 22:50
Show Gist options
  • Save JhonAlx/a5b6f684094bfe1c618c to your computer and use it in GitHub Desktop.
Save JhonAlx/a5b6f684094bfe1c618c to your computer and use it in GitHub Desktop.
gci | foreach {
[int]$LinesInFile = 0
$path = "path" + $_.name
$reader = New-Object IO.StreamReader $path
while($reader.ReadLine() -ne $null){ $LinesInFile++ }
echo $_.name ": " $LinesInFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment