Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell command to move files around

$
0
0

I am putting a script together that will look at project folders and if any one file has not been modified within that folder in x amount of days it will be copied to a different location. If any one file has been modified within x amount of days to do nothing.

I know how to get some of the information I am looking for using lastwritetime and neglectedfiles but I am stuck on how to do a what if statement if that is best. What commands should be used to search the folder for files the have been modified in x days and get a true or false result instead of a list of files. I figure if I get a true or false I can than pipe that to a copy command or do nothing.

Any ideas would be great thank you


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>