PowerShell: from the first command to a safe runbook
PowerShell 7 from the ground up: objects and the pipeline, scripts and functions, errors and exit codes, then what makes operations scripts safe: -WhatIf and ShouldProcess, idempotent runbooks, tests with Pester, analyzer and secrets.
Search the academy Study plan for this course
Who it is for
For everyone who manages Windows, Linux, Azure or Microsoft 365 with scripts or wants to automate their work: developers, administrators, operations staff.
Prerequisites
No particular programming language. Anyone who has seen variables, loops and functions once (K1 or equivalent) can follow. An Azure account of your own helps for the additional Azure exercises.
Afterward, you can
- Find commands, read help and send objects through the pipeline
- Write scripts and advanced functions with validated parameters
- Handle errors, exceptions and the exit codes of native programs
- Secure changes with -WhatIf and -Confirm and build runbooks idempotently
- Test modules with Pester against stand-ins and prove that -WhatIf changes nothing
- Check scripts with an analyzer, protect secrets and run them in a pipeline or automation
Contents
- PS.1
8 h
The shell: commands, objects, pipeline
PowerShell 7 and 5.1, cmdlets, help, objects, pipeline, providers, files, CSV and JSON
- PS.2
8 h
Scripts, functions, errors
scripts, control flow, advanced functions, parameters, errors, exit codes
- PS.3
6 h
Changing safely: WhatIf and runbooks
-WhatIf, -Confirm, ShouldProcess, ConfirmImpact, idempotent runbooks, guarding native tools
- PS.4
8 h
Quality and operations
modules, Pester, analyzer, secrets, Azure, remoting, pipeline, automation, real traps
About 30 hours in all (indicative).
Lessons
You see the text and video of every lesson here on the site after buying the course; the titles and goals are already shown. A self-study course: you work through the lessons in order and check your exercises yourself against the solutions.
You can read the first module (PS.1) for free, with text and video, without signing in: so you see how the course works before you buy.
The lessons stand under their modules, in the order of the course. Click a module to open or close its lessons.
PS.1 The shell: commands, objects, pipeline
Indicative: 8 hours · 3 lessonsfree to read
Lesson 1 · about 180 minutes
First commands: versions, cmdlets, help
Lesson 2 · about 180 minutes
Objects and the pipeline
Lesson 3 · about 120 minutes
Providers, files and data
PS.2 Scripts, functions, errors
Indicative: 8 hours · 3 lessons
Lesson 4 · about 180 minutes
Scripts, variables, control flow
Lesson 5 · about 180 minutes
Functions and advanced parameters
Lesson 6 · about 120 minutes
Errors, exceptions and exit codes
PS.3 Changing safely: WhatIf and runbooks
Indicative: 6 hours · 2 lessons
Lesson 7 · about 180 minutes
-WhatIf and -Confirm: SupportsShouldProcess
Lesson 8 · about 180 minutes
Idempotent runbooks: read, compare, change only the difference
PS.4 Quality and operations
Indicative: 8 hours · 3 lessons
Lesson 9 · about 180 minutes
Modules, manifests and tests with Pester
Lesson 10 · about 180 minutes
Analyzer, secrets and Azure
Lesson 11 · about 180 minutes
Remoting, pipelines, automation and real traps
Final project: the Kladde
What the Kladde can do after this course
A small office tool of a fictional company grows from the first query into a module with tests that runs a runbook safely with -WhatIf and runs in a pipeline.
The course ends with a module exam: a small runbook with -WhatIf, proven with Pester and checked with the analyzer.
Certifications
Microsoft offers no exam of its own for PowerShell itself.
Keep learning with Microsoft Learn
Microsoft's learning paths and documentation that go with this course.