May 2024
Intermediate to advanced
826 pages
18h 13m
English
In PowerShell, scripts and functions are commands. They have overlapping capabilities and often only differ by common use.
Scripts tend to be used to implement well-defined processes; such scripts often run on a schedule of some kind. A script may include functions or run other scripts, and will often use commands from other modules. A script is convenient as it consists of a single ps1 file.
Functions can be used to implement a single process in the same way as a script. A function might be part of a script, implementing a process, or part of a module. When automating a process, writing a module to host a function might be regarded as slightly less convenient and less simple than writing a script.
Read now
Unlock full access