Merge pull request #65 from HedgeComp/Time-to-Complete-Hours

Time To Complete Shows Hours if Needed
This commit is contained in:
rbalsleyMSFT
2024-09-06 11:26:54 -07:00
committed by GitHub
+5 -1
View File
@@ -4366,8 +4366,12 @@ Write-Host "FFU build process completed at" $endTime
# Calculate the total run time # Calculate the total run time
$runTime = $endTime - $startTime $runTime = $endTime - $startTime
# Format the runtime as minutes and seconds # Format the runtime with hours, minutes, and seconds
if ($runTime.TotalHours -ge 1) {
$runTimeFormatted = 'Duration: {0:hh} hr {0:mm} min {0:ss} sec' -f $runTime
} else {
$runTimeFormatted = 'Duration: {0:mm} min {0:ss} sec' -f $runTime $runTimeFormatted = 'Duration: {0:mm} min {0:ss} sec' -f $runTime
}
if ($VerbosePreference -ne 'Continue'){ if ($VerbosePreference -ne 'Continue'){
Write-Host $runTimeFormatted Write-Host $runTimeFormatted