$command = Get-History -Count 1 $delta = $command.EndExecutionTime - $command.StartExecutionTime Write-Output "Last command took $($delta.TotalMilliseconds) ms ($($delta.Days)d $($delta.Hours)h $($delta.Minutes)m $($delta.Seconds)s $($delta.Milliseconds)ms)"