February 28th, 2013

PowerTip: Determine How Long a PowerShell Command Takes

Doctor Scripto
Scripter

Summary: Figure out how long a Windows PowerShell command takes to run.

Hey, Scripting Guy! Question You want to know how long a particular Windows PowerShell command takes to run so you can optimize your code. How can you do this?

Hey, Scripting Guy! AnswerUse the Measure-Command cmdlet and specify the code in the –expression script block.

Measure-Command -Expression {Get-Process}

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.