Skip to content

Instantly share code, notes, and snippets.

@oneillci
Last active February 22, 2018 03:27
Show Gist options
  • Save oneillci/99cd063e4c2df8ebd635fdb3f903ba4c to your computer and use it in GitHub Desktop.
Save oneillci/99cd063e4c2df8ebd635fdb3f903ba4c to your computer and use it in GitHub Desktop.
Powershell find in files, count of lines in files
Get-ChildItem -Recurse -Include *.* | Select-String "column-flex-container"
// Get could of lines in files of type
(dir -include *.scss -recurse | select-string .).Count
or
Get-ChildItem -Filter "*.cs" -Recurse | Get-Content | Measure-Object -line
// Get count of files of type
(dir -include *.ts -recurse).Count
or
Get-Childitem -Filter "*.html" -Recurse | where { -not $_.PSIsContainer } | group Extension -NoElement | sort count -desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment