title: Measure execution time in minutes and seconds
body: <p>I would like to measure multiple times in an automation PowerShell script. I used Get-Date and TotalSeconds. The result looks for example like this: 236.908</p>
  
  <p>How can I get the elapsed time as human readable in minutes and seconds?</p>
  
  <pre><code>$startTime = (Get-Date)
  $endTime = (Get-Date)
  
  $ElapsedTime = (($endTime-$startTime).TotalSeconds)
  
  Write-Host "Duration: xx min xx sec"
  </code></pre>