February 2019
Intermediate to advanced
626 pages
15h 51m
English
The param block must appear before all other code with the exception of attributes. In a script, using statements, if present, must also be written before param.
The param block is used to define the parameters a Script or Function is willing to accept. The keyword is not case-sensitive, so the opening bracket may be placed immediately after (with no space), on the next line, or as shown in this simple example:
param ( $Parameter1, $Parameter2)
By default, parameters have the System.Object type. This means that you can pass just about anything into a parameter. It may be desirable to restrict values to those of a specific type.
Read now
Unlock full access