liveBook · Manning

Param block

A parameter block is a PowerShell construct that declares a script or function’s parameters, default values, and related metadata.

How 2 Manning books explain it

Practical Automation with PowerShell: Effective scripting from the console to the cloud

A parameter block is the section of a PowerShell function or script that declares its input parameters and their metadata.

How it is used
Defines the required and optional inputs that drive reusable archive and log-cleanup automations.
How deep it goes
Explains placement, mandatory flags, types, and defaults through complete function and script listings.
Examples
Demonstrates archive-path inputs, a date parameter, and a 30-day log-retention setting in a cleanup script.
What you can do after
Apply it via PowerShell functions and scripts to declare typed, required, and optional automation inputs.

Read how Practical Automation with PowerShell: Effective scripting from the console to the cloud explains param block →

Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

A param block is a PowerShell language construct that declares the parameters and default values of a script or function.

How it is used
Turns hardcoded script values into inputs for repeatable administrative commands.
How deep it goes
Explains declarations, defaults, invocation forms, types, mandatory attributes, and block punctuation through working scripts.
Examples
Uses Get-DiskInventory with computer-name and drive-type parameters, including mandatory prompting and typed values.
What you can do after
Apply it via PowerShell scripts to replace hardcoded values with named, positional, defaulted, or mandatory inputs.

Read how Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS explains param block →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.