Formatting status line for write-progress

Let's say I have a progress status line that reads:

Processing block 345323123 of 678456234

It would look better if it read:

Processing block 345,323,123 of 678,456,234

Anyone know how to format that?

-f perhaps?

Parents
No Data
Reply
  • Self solved

    $totalNumber = 100000000
    $numcount = 0
    foreach ($number in 100000..$totalNumber ){
    $numcount++
    $number2 = "{0:###,###,###}" -f $number
    $totalNumber2 = "{0:###,###,###}" -f $totalNumber
    Write-Progress -Activity "Bar" -status "$number2 of $totalnumber2" -Percentcomplete ($numcount / $totalnumber * 100)
    start-sleep -seconds 1
    write-host $number
    }

Children
No Data