PowerShell Job Progress Monitoring

Question:

Is there a way for a PowerShell job to report progress or to trigger events before it is complete? I just started playing around with executing background jobs in PowerShell and am wondering how far I can push the capability.

Answer:

The standard “manual” way is to use the Get-Job cmdlet. As for events, when you create a job with Start-Job, the Job object returned has a “StateChanged” event on it you can subscribe to e.g.:

Source:

PowerShell Job Progress Monitoring by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply