title: Move files incrementally by file size and wait till the destination gets emptied before moving files again either using Robocopy or Powershell
body: <p>I would like to ask how can I move files from a source folder to a destination folder as shown in the image. The sum of file size from the source folder can only be moved not larger than 7GB (or I can set that depending on the largest single file like 5GB) and then wait for the files moved to the destination folder to get ingested (emptied) before moving again the next batch of files. I have an idea of using a Robocopy or Powershell script that moves the files and is automatically triggered using a Task Scheduler but I have no experience scripting on any of these. Would appreciate any idea/link/sample code that you can provide as a reference. Thanks</p>
  <p><a href="https://i.stack.imgur.com/EITk4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EITk4.png" alt="enter image description here" /></a></p>