I have few background jobs running in powershell and i'm trying to find a way to get the count of jobs "Running" and "Completed" which updates automatically once the job is completed.
function jobDetails {
$d = Get-Job | Measure-Object -Property Name
Write-Output "Total Number of Jobs = " $d.Count
$d = (Get-Job -State Running)
Write-Output "Number of Jobs Running = " $d.count
$d = (Get-Job -State Completed)
Write-Output "Number of Jobs Completed = " $d.count
}
please help me out as I'm a newbie to coding