I have a script which copies some files to a backup storage. And I added a timer to see how much time it would use doing this. I used
$script:start = Get-Date
$start = (Get-Date)
Copy-Item $var0, $var1, $var2 Folders -force -recurse -verbose -Exclude name
$endFulltime = (Get-Date)
"$(($endFulltime-$startFulltime).totalminutes)"
The problem with this is the output. It gives me something like 0,34255234561245 minutes or if I put it in seconds, it just looks the same, but with different numbers. So the problem isn't that it gives me a wrong output; it just looks a bit messy.
Would it be possible to get output like 5 minutes and 43 seconds? Instead of this really long number.