August 15, 2017

PowerShell - working with Progress Bar

This PowerShell script generates a number between 0 and 1000000. It calculates an average value, which is surprisingly leading to the middle. SecondsRemaining parameter from Write-Progress cmdlet is reused to show total time used. Additionally CPU load bar is added.

Script output example

Script works with performance counters, almost all examples of Write-Progress cmdlet, .ToString("##") conversion usage (another examples could be ##.##, ##.#).

No comments:

Post a Comment