Hello Windows people:
I’m not used to administering a Windows box, and Powershell is what I turned to since I wanted to work in a shell. Our network drives have possibly several millions of files, so the team decided that I come up with a solution to move and or delete files.
the script is :
Get-Childitem -Path -Recurse -Exclude '$_aaa_directory' |
Select-Object -Property FileName, Extension, LastAccessTime, LastWriteTime |
where {$._LastAccessTime -lt (Get-Date).AddDays (-1845) } | Export-Csv 'old-files.csv'
My question is, I ran the script a couple of times as I optimized it and got a grasp of what to expect, The files have not been accessed by anyone as this was done during a weekend. Why would the LastAccessTime
be changed on some of the files ( roughly the first 200 ) with the most recent time I ran the script, yet still appeared on the csv file though I need files older that 1845 days?