View Single Post
Old 04-14-2008   #1 (permalink)
David Stuart
Guest


 

How to delete "old" directories (recursively)?

Hello,

I have a very deeply nested directory structure which is part of a
loadbuild system. Because our loadbuild machine periodically runs out of
space, I would like to run a scheduled task which deletes old
build artifacts.

So, how can I make a powershell script which deletes (recursively)
directories which are older than X days? I'm not that familiar with the
..NET APIs, which is (I think) why I'm running into trouble on this one.

Thanks for the help. I imagine this is pretty easy for powershell veterans.