If you’ve ever wondered how long it takes to perform a specific task then the Measure-Command cmdlet is exactly what you’ve been looking for: it enables you to measure the running time of a command or script down to the millisecond. Simply simply call the cmdlet you want to profile, using the command or script to be run as the cmdlet parameter inside curly braces. For example, you can measure the time it takes to get a list of all the running process on the local computer (or on a remote one) by means of the Get-Process cmdlet: open the Powershell window and execute the following command
PS C:\Users\Luigi\Measure-Command {Get-Process}
You'll get an output like the following (captured from an English Windows 7 with Powershell version 3)
This article is also available in the following languages:
Luigi Bruno edited Revision 2. Comment: Edited the "Measuring Cmdlet Execution Time" section.
Luigi Bruno edited Revision 1. Comment: Edited article's title.
Luigi Bruno edited Original. Comment: Added the "Multi Language Wiki Articles" tag. Added the "See Also" section.