Summary

In this chapter, you examined two basic concepts: passing command-line arguments and working with arrays. These two vital tools are heavily utilized on a daily basis in enterprise scripts. To make a script more flexible, for example, avoiding having to edit a script just to enable it to run against various servers on the network, you use command-line arguments. Arrays are used to make scripts more powerful, efficient, and robust. By storing multiple values in memory, you avoid having to make multiple calls to either the file system or to another source of information. Indeed, all you need to do is store your configuration information within an array, and you’re ready to go.

Get Microsoft® Windows® Scripting Self-Paced Learning Guide 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.