Find Directories Matching Criteria and Sum Contents

by May 26, 2011

New to powershell, and have been having some trouble coming up with a way to find directories that have been created within X days (or after a certain date) and then getting the size of all the contents of that directory.

I used to use the find and du commands in linux for this, see below for an example.

find -ctime -7 -type d -exec du –max-depth 1 {} ;

Thanks