December 12th, 2015

PowerTip: Time How Long PowerShell Command Takes to Complete

Doctor Scripto
Scripter

Summary: Easily time how long a Windows PowerShell command takes to complete.

Hey, Scripting Guy! Question How can I time how long a command takes to complete in Windows PowerShell?

Hey, Scripting Guy! Answer Use the Measure-Command cmdlet—for example, to time how long it takes to Get-Process (gps is an alias)
           to complete, put the command in a script block and call Measure-Command:

Measure-Command {gps}

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.