Phil Pearce
asked on
Script Help - Moving old files
Hi,
I'm wondering if someone could help me. I'm looking for assistance in script creation.
At the moment I have a drive full of files. What I'm going to do is create an archive drive.
What I would like to do is move all the files that were last accessed over 4 years ago to this new drive but maintain the directory structure. So they are moved to the same directory but in a new location.
I can locate the files using this script
Just wondering if someone could help me modifying the script to help me achieve what I am after?
Thanks
I'm wondering if someone could help me. I'm looking for assistance in script creation.
At the moment I have a drive full of files. What I'm going to do is create an archive drive.
What I would like to do is move all the files that were last accessed over 4 years ago to this new drive but maintain the directory structure. So they are moved to the same directory but in a new location.
I can locate the files using this script
get-childitem G:\ -Exclude CaseTracking,Sage50 -rec -ErrorAction SilentlyContinue | where {!$_.PSIsContainer -AND $_.lastAccessTime -lt (Get-Date).AddDays(-1460)} | select-object FullName, LastWriteTime | export-csv -notypeinformation -delimiter '|' -path c:\temp\file.csv
Just wondering if someone could help me modifying the script to help me achieve what I am after?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window