I have this line of code to move files and folders over a certain age to another folder
But it doesnt work, I run it but it just goes back to a prompt
Get-ChildItem -Recurse c:\test | where-Object {$_.Creationtime -lt (Get-Date).AddMonths(-6)} | ForEach-Object { robocopy "c:\test" "c:\old" /Z /S }