title: Powershell - Measure size of .tmp files (The property 'Length' cannot be found)
body: <p>I am trying to measure the recursive size of a ccmcache directory that is currently being downloaded with BITS.</p>
  
  <p>I am using the following Powershell script to measure the recursive size of the directory.</p>
  
  <pre><code>(Get-ChildItem $downloadPath -recurse | Measure-Object -property Length -sum).Sum
  </code></pre>
  
  <p>This script works for "normal" directories and files, but it fails with the following error if the directory only contains <code>.tmp</code> files.</p>
  
  <pre><code>Measure-Object : The property "Length" cannot be found in the input for any objects.
  At line:1 char:27
  + (Get-ChildItem -Recurse | Measure-Object -Property Length -Sum).Sum
  +                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (:) [Measure-Object], PSArgumentException
      + FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft.PowerShell.Commands.MeasureObjectCommand
  </code></pre>
  
  <p>How can I measure the recursive size of a directory that only contains <code>.tmp</code> files created by the BITS downloader.</p>