I ended up using a custom progress bar instead:
Remove-Variable * -ErrorAction SilentlyContinue
function progress_bar($pctg_complete, $label, $leftend = "[", $rightend = "]", $counter = "#", $filler = ".", $completed = $false, $color = "white", $bar_length = 10)
{
$pctg_complete = [math]::ceiling($pctg_complete) # making it a INT
# here $bar_length can be adjusted to increase the size of the PROGRESS BAR
if ($label -eq $null) # if no LABEL given then use this
{
$label = "My Process"
}
if ($completed -eq $true) # to CLOSE the progress bar
{
write-host "`r`b" -NoNewline
$pctg_complete = 100
$progress_bar = "$label $leftend" + ($counter*$bar_length*($pctg_complete/10)) + ($filler*$bar_length*((100 - $pctg_complete)/10)) + "$rightend $pctg_complete %"
write-host $progress_bar -NoNewline -ForegroundColor $color
}
else
{
$progress_bar = "$label $leftend" + ($counter*$bar_length*($pctg_complete/10)) + ($filler*$bar_length*((100 - $pctg_complete)/10)) + "$rightend $pctg_complete %"
write-host $progress_bar -NoNewline -ForegroundColor $color
Start-Sleep -Seconds 1
if ($pctg_complete -ne 100)
{
write-host "`r`b" -NoNewline
}
}
}
## SIMPLE USAGE
# simple progress bar with "#" counters and Label=Test
progress_bar -pctg_complete 10 -label "Test"
Start-Sleep -Seconds 1
progress_bar -pctg_complete 50 -label "Test"
Start-Sleep -Seconds 1
# should have one of this (or both) at end of your process, to close the progress bar
progress_bar -pctg_complete 100 -label "Test"
progress_bar -completed $true -label "Test"
Start-Sleep -Seconds 1
#OUTPUT:
#Test [##################################################..................................................] 50 %
## ADVANCED USAGE
# here giving percentage complete in decimals
# giving unicode characters ░ as filler and █ as counter
# also using "|" as the left and right end character
# also modifying the color to Green
progress_bar -pctg_complete 8.9 -label "Test" -counter "$( [char]0x2588 )" -filler "$( [char]0x2591 )" -leftend "|" -rightend "|" -color Green
Start-Sleep -Seconds 1
progress_bar -pctg_complete 45.6 -label "Test" -counter "$( [char]0x2588 )" -filler "$( [char]0x2591 )" -leftend "|" -rightend "|" -color Green
Start-Sleep -Seconds 1
progress_bar -pctg_complete 98.523 -label "Test" -counter "$( [char]0x2588 )" -filler "$( [char]0x2591 )" -leftend "|" -rightend "|" -color Green
progress_bar -completed $true -label "Test" -counter "$( [char]0x2588 )" -filler "$( [char]0x2591 )" -leftend "|" -rightend "|" -color Green
Start-Sleep -Seconds 1
#OUTPUT:
#Test |███████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░| 46 %