A switch parameter is a Boolean-style command parameter whose presence enables an option without requiring an input value.
A switch parameter turns an option on simply by appearing in a command. It accepts no input value, so typing the parameter name is enough. section 3.5.4section 4.3
Remember these practical rules:
Type the parameter name, or an accepted abbreviation; switches are never positional. section 3.5.4
Choose whether to include the switch because switches are optional. section 3.5.4
Keep the dash attached to the parameter name and separate parameters with spaces. section 4.3
Including hidden items
Get-Item .* lists no files in the described case, while Get-Item .* -Force tells the command to include items beginning with ., which are treated as hidden. The -Force parameter needs no value. section 3.5.4
How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it
How deep it goes
Explains syntax, optionality, positional rules, and a hidden-file example, without descending into implementation details.
Examples
Demonstrates Get-Item .* with and without -Force, contrasting ordinary retrieval with hidden-item inclusion.
What it assumes
Assumes basic PowerShell command entry while clarifying parameter names, dashes, spaces, and values.
What you can do after
Apply it via PowerShell by recognizing switches and adding options such as -Force without supplying values.
How it connects
Connects switch parameters with cmdlets, named parameters, command syntax, and hidden items.
inputkind of · An input is a value, information, or signal supplied to a system, computation, or interface for processing or to influence its behavior.
-Syntaxincludes · -Syntax is a Get-Command parameter that displays the syntax of a command.
This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.