Skip to content

Instantly share code, notes, and snippets.

@atruskie
Created October 5, 2016 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atruskie/2c06078b266343445c42d41efd0cc224 to your computer and use it in GitHub Desktop.
Save atruskie/2c06078b266343445c42d41efd0cc224 to your computer and use it in GitHub Desktop.
A one-liner I used to search through several hundred folders to find which ones did not have the same number of files/directories inside them.
ls . -Directory | % { $count = (ls $_ -Recurse).Count; $_ | Select *,@{Name="count"; Expression={$count} } } | Group-Object Count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment