RRinTetons
IS-IT--Management
I want to give PowerShell an explicit list of file paths to several directories and have it copy the most recent file found in each directory to a common location.
e.g., given the list
Z:\RTPSQL\DataFileBackups\RTPOne
Z:\Dynamics-GP
Z:\TimeCentre\tc2kdb
Z:\FoodTrak
Z:\FleetMax
I want to get the most recent file out of each of those directories and copy it to another directory named
C:\ForArchive
I have scripts to copy the entire contents of a directory, or to copy an explicit file name from a directory, but not to get the most recent file regardless of its name.
Suggestions?
-
Richard Ray
Jackson Hole Mountain Resort
e.g., given the list
Z:\RTPSQL\DataFileBackups\RTPOne
Z:\Dynamics-GP
Z:\TimeCentre\tc2kdb
Z:\FoodTrak
Z:\FleetMax
I want to get the most recent file out of each of those directories and copy it to another directory named
C:\ForArchive
I have scripts to copy the entire contents of a directory, or to copy an explicit file name from a directory, but not to get the most recent file regardless of its name.
Suggestions?
-
Richard Ray
Jackson Hole Mountain Resort