PowerShell - Find Wild Card Directory With Hidden Attribute Within Past X Days
Posted on 2014-01-16
- I need to create a PowerShell that will look for directories called "*.view".
- These directories have a Hidden attribute, so I only want to find those directories that are hidden.
- I'd like to look for directories that are older than X amount of days.
- For safety reasons, I'd like two options for output and I'll just comment out the one I don't need to use at any given time.
- First options is to create an output file to the desktop, so i can review it and make sure it's correct.
- The second option would be to actually remove the directories. Again, I'll just comment out the one I don't want to use when I first run the script.