Powershell script to delete sub folders and files if creation date is >7 days but maintain parent folders of sub folders and files <7 days old
- by Mark
I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date.
The problem with this script is this:
If folder "A" is seven (or more) days old it will be deleted even if its sub folders and files are less then…