June 2025
Beginner to intermediate
473 pages
13h 30m
English
Functions provide the option to bundle multiple PowerShell commands, which facilitates organizing extensive scripts. In its simplest form, a function has the following structure:
function Do-Something { command1 command2 ...} Within a script, functions can only be used after they have been defined. Thus, a script file first contains all the functions, while the code that is ultimately to be executed is located at the end.
The PowerShell documentation recommends naming custom functions, such as cmdlets, according to the verb-noun pattern. The hyphen required in the name, like almost any other character, can be used without special marking.
What is unusual compared to ...
Read now
Unlock full access