title: Splitting a folder in smaller ones with a certain size
body: <p>I am trying to divide a folder into folders with a maximum size of, let's say 8 GB.</p>
  
  <p>starting folder:</p>
  
  <pre class="lang-none prettyprint-override"><code> Folder 1
    2KB file
    2GB file
    7GB file
   Folder 2
    1GB file
    5.6GB file
   Folder 3
    8GB file
  </code></pre>
  
  <p>which i want to turn into:</p>
  
  <pre class="lang-none prettyprint-override"><code>  Folder A (~7.6GB)
     Folder 1
       2KB file
       2GB file
     Folder 2
       5.6GB file
   Folder B (8GB)
     Folder 1
       7GB file
     Folder 2
       1GB file
   Folder C (8GB)
     Folder 3
       8GB file
  </code></pre>
  
  <p>The goal is that you can combine the folders and get the structure of the original folder.</p>
  
  <p>Is something like this even possible with powershell? I've seen some solutions with bash and dirsplit, but i'd really like to keep it in powershell, unless there is a simple and clean solution with some already existing software.</p>
  
  <p>I forgot to add that the folders might not only include files, but sometimes folders too. Is there a solution that does this recursively to a certain extent?</p>
  
  <p>It feels like i am missing something, considering i haven't worked a lot with powershell.</p>