title: how to automatically update the count of background jobs running in powershell?
body: <p>I have few background jobs running in powershell and i'm trying to find a way to get the count of jobs &quot;Running&quot; and &quot;Completed&quot; which updates automatically once the job is completed.</p>
  <pre><code>function jobDetails {
      $d = Get-Job | Measure-Object -Property Name
      Write-Output &quot;Total Number of Jobs = &quot; $d.Count
      $d = (Get-Job -State Running)
      Write-Output &quot;Number of Jobs Running = &quot; $d.count
      $d = (Get-Job -State Completed)
      Write-Output &quot;Number of Jobs Completed = &quot; $d.count
  }
  </code></pre>
  <p>please help me out as I'm a newbie to coding</p>