From 76e6a925fc1e5ca968135f9b5d07456011617526 Mon Sep 17 00:00:00 2001 From: Sven Giermann Date: Thu, 6 Aug 2026 09:18:56 +0200 Subject: [PATCH] Fix Format-Duration to support spans greater than 24 hours Format-Duration currently only disaplays up to 23:59:59, no matter if TotalHours is greater than 24. This fix additionally displays the number of days in that case. --- Swarm/FileFly/Analysis/Folder-Analysis-HTML.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Swarm/FileFly/Analysis/Folder-Analysis-HTML.ps1 b/Swarm/FileFly/Analysis/Folder-Analysis-HTML.ps1 index c2a8a6e..54d7130 100644 --- a/Swarm/FileFly/Analysis/Folder-Analysis-HTML.ps1 +++ b/Swarm/FileFly/Analysis/Folder-Analysis-HTML.ps1 @@ -85,7 +85,8 @@ Write-Host "Please wait..." -ForegroundColor Yellow function Format-Duration { param([TimeSpan]$Span) - if ($Span.TotalHours -ge 1) { return $Span.ToString('hh\:mm\:ss') } + if ($Span.TotalDays -ge 1) { return $Span.ToString('dd\.hh\:mm\:ss') } + elseif ($Span.TotalHours -ge 1) { return $Span.ToString('hh\:mm\:ss') } return $Span.ToString('mm\:ss') } @@ -664,4 +665,4 @@ $scriptStopwatch.Stop() Write-Host "Total processing time: $(Format-Duration $scriptStopwatch.Elapsed)" -ForegroundColor Cyan # Open HTML in default browser -try { Invoke-Item $OutputPath } catch { } \ No newline at end of file +try { Invoke-Item $OutputPath } catch { }