Chapter 10. Optimizing Script Execution Speed

When you execute the Windows server scanning script, you most likely will be processing a large number of objects. Small efficiencies in your coding practices can equate to exponentially faster execution times for large sets of data. Due to PowerShell being so flexible, it is possible to write two different sets of code that perform the exact same activity. However, you will find that certain coding techniques are much more efficient than others. In some cases, you can increase your script performance by over 200 percent.

This chapter focuses on the quick changes that you can make to your scripts to optimize efficiency. You will also learn about cmdlets and methods that you should avoid to ensure that ...

Get Enterprise PowerShell Scripting Bootcamp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.