How to measure a script’s run time

#at the beginning of the script

$StartTime = (Get-Date)

 

#at the end of the script

write-host “Script ran for :”$([timespan]::fromseconds(((Get-Date)-$StartTime).Totalseconds).ToString(“mm\:ss”))

 

Leave a Reply

Your email address will not be published. Required fields are marked *