title: Powershell Get-ChildItem progress question
body: <p>So, I've got a set of directories 00-99 in a folder. Each of those directories has 100 subdirectories, 00-99. Each of those subdirectories has thousands of images. </p>
  
  <p>What I'm attempting to do is basically get a progress report while it's computing the average file size, but I can't get that to work. Here's my current query:</p>
  
  <pre><code>get-childitem &lt;MyPath&gt; -recurse -filter *.jpeg | Where-Object { Write-Progress "Examining File $($_.Fullname)" true } | measure-object -Property length -Average
  </code></pre>
  
  <p>This shows me a bar that updates as each of the files gets processed, but at the end I get back no average file size data. Clearly, I'm doing something wrong, because I figure trying to hack the Where-Object to print a progress statement is probably a bad idea(tm). </p>
  
  <p>Since there are millions and millions of images, this query obviously takes a VERY LONG time to work. get-childitem is pretty much going to be the bulk of query time, if I understand things correctly. Any pointers to get what I want? AKA, my result would ideally be:</p>
  
  <pre><code>Starting...
  Examining File: \00\00\Sample.jpeg
  Examining File: \00\00\Sample2.jpeg
  Examining File: \00\00\Sample3.jpeg
  Examining File: \00\00\Sample4.jpeg
  ...
  Examining File: \99\99\Sample9999.jpg
  Average File Size: 12345678.244567
  </code></pre>
  
  <p>Edit: I can do the simple option of:</p>
  
  <pre><code>get-childitem &lt;MyPath&gt; -recurse -filter *.jpeg | measure-object -Property length -Average
  </code></pre>
  
  <p>And then just walk away from my workstation for a day and half or something, but that seems a bit inefficient =/</p>