In the past I usually took the lazy way out, which is to just print another period every 100 iterations or so. I just came across a cmdlet called Write-Progress that comes in handy here.
Check out the following code:
foreach ($index in (1..1000)) {
Write-Progress -activity 'Destroying Earth' -status 'Obliterating...' -percentComplete ($index / 10)
}
No comments:
Post a Comment