Parameters: `param()`

A param() block at the top of a script names its inputs, so one script works on any folder; each parameter can have a type, a default value or be a [switch], Mandatory makes PowerShell ask for a missing one, and Tab completes their names.

Updated

Cheat sheet for the lesson Parameters: `param()`: A param() block at the top of a script names its inputs, so one script works on any folder; each parameter can have a type, a default value or be a [switch], Mandatory makes PowerShell ask for a missing one, and Tab completes their names.
Category
PowerShell
Level
Apprentice
Tags
mandatory-parameter, param-block, parameter, positional-parameter, powershell, switch-parameter, tab-completion