Measuring the Execution Time of PowerShell Code
If you want to optimize the speed of your PowerShell code, it makes sense to measure times. There are several ways to measure how long a piece of PowerShell code takes to run. 🎬 I have also created a video on this topic. Option 1: Measure-Command A simple way is to use the Measure-Command cmdlet. It accepts a script block, which is then executed. We then get a measurement result in the form of a TimeSpan object. A simple example: ...