As I am preparing for a few of my upcoming PowerShell sessions, such as “Howto use PowerShell v3 to make your scripts X times faster” (Experts 2 Experts Virtualization Conference), I’m using a PowerShell cmdlet to time my scripts, namely the Measure-Command cmdlet. This way you can truly see the advantages of using different approaches to accomplish the same things
For example, getting all files with a specific extension can be done in a lot of different ways. By using the correct approach for that goal, you can make your scripts a lot faster! An example:
But when I use the –filter parameter instead of the –include parameter, it provides the same output but a lot faster!
Conclusion: Use the right tool for the right task