title: Powershell folder size of folders without listing Subdirectories
body: <p>I have found several resources that use the following script to get folder sizes</p>
  
  <pre><code>$colItems = (Get-ChildItem $startFolder -recurse | Where-Object {$_.PSIsContainer -eq $True} | Sort-Object)
  foreach ($i in $colItems)
      {
          $subFolderItems = (Get-ChildItem $i.FullName | Measure-Object -property length -sum)
          $i.FullName + " -- " + "{0:N2}" -f ($subFolderItems.sum / 1MB) + " MB"
      }
  </code></pre>
  
  <p>The problem with that is it also lists the subdirectories ie:</p>
  
  <pre><code>c:\test\1 -- 10mb
  c:\test\1\folder -- 10mb
  c:\test\1\folder\deep -- 5mb
  c:\test\1\folder\tuna -- 5mb
  c:\test\2 -- 20bm
  c:\test\2\folder -- 20mb
  c:\test\2\folder\deep -- 10mb
  c:\test\2\folder\tuna -- 10mb
  </code></pre>
  
  <p>I think you know see where I am going.  What I am looking for is just the parent folder's results...  SO:</p>
  
  <pre><code>c:\test\1 -- 10mb
  c:\test\2 -- 20mb
  </code></pre>
  
  <p>How can this be accomplished with Powershell?
      ....</p>