Summary: Measure how long it takes for a Windows PowerShell command to complete.
If I change one command to try to improve the speed of my Windows PowerShell script , how can I see if
that command is faster than the one I changed?
Use the Measure-Command cmdlet. For example, to see if Get-Date or [datetime]::now is faster,
place the command in a script block as shown here:
Measure-Command -Expression {get-date}
Measure-Command -Expression {[datetime]::now}
0 comments