Windows 2003 file server
Here is the script: (moves files that have not been accessed for 30 days to the drive E:\backup)
get-childitem P:\download -rec| where -FilterScript {$_.LastAccessTime -le [System.DateTime]::Now.AddDays(-30)} |move-item -destination "E:\backup"
issue: all files results end up in one single file backup even I specify E:\backup.
Questions: is there a way to move these files according to their source folder structures in the destination path E:\backup
ex: source Target
P:\download\it\1.txt E:\backup\it\1.tct
P:\download\it\2\po.txt E:\backup\it\2\po.txt
-------------------
Thank you.