Write-ProgressHelper.ps1
19 Sep 2025Description
Purpose
No synopsis provided.
Detailed Description
No detailed description provided.
Usage
No usage examples provided.
Notes
No additional notes.
Script
function Write-ProgressHelper {
<#
Write-ProgressHelper -Message 'Doing something' -StepNumber ($stepCounter++)
Start-Sleep -Seconds 5
## Some process here
Write-ProgressHelper -Message 'Doing something2' -StepNumber ($stepCounter++)
Start-Sleep -Seconds 5
## Some process here
Write-ProgressHelper -Message 'Doing something3' -StepNumber ($stepCounter++)
Start-Sleep -Seconds 5
$tcount = 100
for($i=0;$i -le $tcount; $i++){
$pcomplete = ($i / $tcount) * 100
Write-Progress -Activity "Counting from 1 to 100" -Status "Counting $i times" -PercentComplete $pcomplete
Start-Sleep 1
}
#>
param (
[int]$StepNumber,
[string]$Message
)
$stepCounter = 0
Write-Progress -Activity 'Title' -Status $Message -PercentComplete (($StepNumber / ($stepCounter).count ) * 100)
}
Download
Please feel free to copy parts of the script or if you would like to download the entire script, simply click the download button. You can download the complete repository in a zip file by clicking the Download link in the menu bar on the left hand side of the page.
Report Issues
You can report an issue or contribute to this site on GitHub. Simply click the button below and add any relevant notes. I will attempt to respond to all issues as soon as possible.