Added #TotalTime# option to Show-Progress Status
This commit is contained in:
parent
2f317c53f3
commit
499a86baa6
|
@ -34,10 +34,12 @@ if( $Elapsed ) {
|
||||||
if( -not $Status ) {
|
if( -not $Status ) {
|
||||||
$progressParams.Status = "Running for #Elapsed#"
|
$progressParams.Status = "Running for #Elapsed#"
|
||||||
}
|
}
|
||||||
$progressParams.Status = $progressParams.Status -replace '#Elapsed#',$(ConvertFrom-TimeSpan $Elapsed)
|
$local:TotalTime = [TimeSpan]::Zero
|
||||||
if( $TotalSeconds ) {
|
if( $TotalSeconds ) {
|
||||||
$progressParams.PercentComplete = [Math]::Floor($(1000 * (($Elapsed.TotalSeconds * 1.0) / ($TotalSeconds * 1.0)))/10.0)
|
$progressParams.PercentComplete = [Math]::Floor($(1000 * (($Elapsed.TotalSeconds * 1.0) / ($TotalSeconds * 1.0)))/10.0)
|
||||||
|
$TotalTime = [TimeSpan]::FromSeconds($TotalSeconds)
|
||||||
}
|
}
|
||||||
|
$progressParams.Status = $progressParams.Status -replace '#Elapsed#',$(ConvertFrom-TimeSpan $Elapsed) -replace "#TotalTime#",$(ConvertFrom-TimeSpan $TotalTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
If( $ItemProgress ) {
|
If( $ItemProgress ) {
|
||||||
|
|
Loading…
Reference in New Issue