Chapter 12. Handling Input and Output

There are few scripts that neither receive input nor produce output. These are primarily scripts that run a series of commands in a preconfigured, batch-oriented manner. Most scripts by IT professionals, however, require either input or output, and most scripts need both. Clearly, for maximum flexibility, scripts must receive input. To maximize utility, most scripts have to produce output.

The form of input and the manner of output are part of the design process and therefore are the purview of the scriptwriter. Traditional input takes the following forms:

  • Read from the command line

  • Read from a ...

Get Windows PowerShell™ 2.0 Best Practices 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.