title: Copy files until they exceed a specified size
body: <p>I need to copy files to a folder until they exceed a specified size. I've written the following script but it fails with the following error:</p>
  
  <blockquote>
    <p>Cannot compare "Microsoft.PowerShell.Commands.GenericMeasureInfo" because it is not IComparable.
    At C:\33.ps1:8 char:1
    + "{0:N2}" -f ($colItems.sum / 1024MB)</p>
  </blockquote>
  
  <pre><code>$files = Get-ChildItem C:\source -Recurse | % { $_.FullName }
  
  foreach($file in $files) {
      do {
  
          Copy-Item $file -Recurse D:\target
          $colItems = (Get-ChildItem d:\target -recurse | `
                           Measure-Object -property length -sum)
          "{0:N2}" -f ($colItems.sum / 1024MB)
      }
      while ($colItems -le 10)
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>