7.5. Writing the main code
Recall from the beginning of this chapter that we have two possible situations to deal with:
- If objects are piped into the function, the PROCESS block will execute multiple times. Since we plan to pipe in computer names, that means $ComputerName would only contain one computer name each time PROCESS executes.
- If data is provided solely via the function’s parameters, PROCESS will execute just once. For us, that means $ComputerName would contain a collection of multiple computer names when PROCESS executes.
We haven’t wired things up to even accept pipeline input yet, but we plan to, because we said so in our design. So we need
to understand that $ComputerName might contain one name, or might contain multiple names. ...