title: PowerShell. How to process Current Item count against Total Item Count
body: <p>I have a script for installing remote updates and that all works fine. I'm just looking to try and add some semblance of keeping track of the progress of the updates.</p>
  <p>I can get the total count by doing</p>
  <pre><code>$TargetUpdates = Get-ChildItem &quot;C:\Updates -Recurse
  $TargetUpdates.Count
  </code></pre>
  <p>and this shows my total count. And then in my <code>ForEach</code> statement I want it to say it's processing update <code>x</code> of <code>i</code></p>
  <p>below is a snippit of the ForEach statement.</p>
  <pre><code>ForEach($Update in $TargetUpdates){
  
  Write-Host &quot;[${Env:ComputerName} Processing Update [x] of [i]...
  }
  </code></pre>
  <p>The <code>[x] of [i]</code> part is where I'm lost. It's probably something real simple I'm just not able to get my head around it.</p>