Chapter 22. Modular Script Programming

IN THIS CHAPTER

Throughout this book, I advocate the use of functions and subs to encapsulate useful script routines. This type of encapsulation makes it easy to cut and paste functions and subs into future scripts, allowing you to easily reuse script code that may have taken you a while to write and debug. I’ll start this chapter with a methodical look at modularization.

Looking for Modules

Modularization can sometimes seem like a lot of extra work. It’s really a matter of training yourself, though: I generally find that writing my code in modules doesn’t take any extra time if I do so to begin with (obviously, converting ...

Get VBScript, WMI, and ADSI Unleashed: Using VBScript, WMI, and ADSI to Automate Windows® Administration 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.