Link to home
Start Free TrialLog in
Avatar of SquigglyMonkey
SquigglyMonkey

asked on

Powershell script to move files

I see the cmdlet move-item, and wonder how I can move files based on age (>4 years) or I guess conversely not move files that have been accessed in the last 4 years or less.

Thx!
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You first get all objects with get-childitem, then filter with where-object for age, and pipe the remaining objects to move-item. The difficult part is to replace the root part of the source by the target root ...