Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Measure Performance of PowerShell Command

$
0
0

Summary: Measure how long it takes for a Windows PowerShell command to complete.  

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer 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}


Viewing all articles
Browse latest Browse all 3333

Trending Articles