I developed a PowerShell script, and it's working absolutely fine. The only challenge is the files in the subfolders are not getting moved to the destination.
get-childitem -Path "\\servername\location" |
where-object {$_.LastWriteTime -lt (get-date).AddDays(-31)} |
move-item -destination "C:\Dumps"
I am unable to customize the script further.
Don't waste your time trying to re-invent robocopy
in PowerShell.
robocopy \\servername\location C:\Dumps /e /mov /minage:31
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With