Chapter 11. 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 written by IT professionals 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 text file
Read from ...
Get Windows PowerShell 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.