Saturday, May 11, 2019

PowerShell: Measure-Command


This is how we can measure a command or script block run on PowerShell like Linux time command.



PS C:\Users\drago> $i=0; Measure-Command { for ($i=1; $i -le 10; $i++) { Write-Progress -Activity "measure running time

" -Status "$i% completed" -PercentComplete $i; sleep 1;

>> }} | Select-Object Seconds




Seconds

-------

10

No comments:

Post a Comment