Powershell move files older than




















Output Folder and Subfolders: You can see below it is empty as of now. Execute MoveFile. We can see the files which were older than 3 days in FileIn folder have been moved to FileOut and respective subfolders also created. Blog Post. Utilities 0. Jamiec k 12 12 gold badges silver badges bronze badges. Maurizio Schmidt Maurizio Schmidt 1 1 gold badge 1 1 silver badge 3 3 bronze badges.

If you take out the ErrorAction does it produce any errors? FYI, that will not move files in sub directories. Add a comment. Active Oldest Votes. Improve this answer. Matthew Steeples Matthew Steeples 7, 4 4 gold badges 34 34 silver badges 47 47 bronze badges. JPBlanc: Thanks very much, yes I do mean get-childitem.

I'm used to writing gci. Have updated my post — Matthew Steeples. Maurizio Schmidt: If you have files in subfolders this won't do it. You'll have to use the -Recurse flag on get-childitem, and additionally you'll have to work out how to move to the right folder on the destinations — Matthew Steeples.

Matthew: Now it works perfectly, thx. Show 1 more comment. Microsoft Business. Microsoft Enterprise. Browse All Community Hubs.

Turn on suggestions. Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. Showing results for. Show only Search instead for. Did you mean:. Sign In. Anthony Bartolo. Published Mar 26 AM Lets begin. LastWriteTime -lt Get-Date. Tags: clean.



0コメント

  • 1000 / 1000