Jan 31 2018 01:19 AM - edited Jan 31 2018 02:11 AM
Hi
I need a poweshell script that move all new arrived pdf files from one folder to an other folder.
- New pdf files detaches from email to d:\daownload folder
- A scheduled job looks twice a day in d:\download folder and move all arrived pdf files to d:\PDF files\
Thanks a lots for any help
/Soran
Jan 31 2018 02:32 AM
Solution#get all pdf files in "d:\download\ creqated in last 12 hours $Files = Get-ChildItem "d:\download\*.pdf" | Where {$_.CreationTime -gt (Get-Date).AddHours(-12)} #Move files to "D:\PDF files\" ForEach ($File in $Files) { Move-Item -Path $File.FullName -Destination "D:\PDF files\" }
then create a scheduled task to run the script twice a day
Jan 31 2018 04:25 AM