PowerShell Tutorial with Examples.
PowerShell tutorial for Windows and cross-platform automation: the object pipeline, cmdlets, modules and remoting, with real console output.
Beginner
Start here — no prior experience needed
PowerShell's Object Pipeline
PowerShell cmdlets pass real .NET objects between each other, not text — see what that means the first time a bash habit like piping to Select-String quietly does the wrong thing.
Sorting, Grouping, and Measuring Objects
Sort-Object, Group-Object, and Measure-Object turn a list of live objects into an answer — until one of them sorts numbers as text, which is the same trap grep-and-sort scripts fall into.
Variables, Arrays, Hashtables, and the $null Trap
PowerShell variables are dynamically typed and forgiving — until a hashtable property inside a string, or a null comparison in the wrong order, quietly does something other than what it looks like.
Control Flow, Functions, and Pipeline Input
PowerShell's switch tests every matching case by default, not just the first — and a function that accepts pipeline input silently drops every item but the last until it gets a process block.
Intermediate
For developers with core concepts down
Files, CSV, and JSON: What Survives the Round Trip
Get-ChildItem returns real file objects to filter directly — but exporting one with a nested property to CSV silently flattens it to the text 'System.Object[]', and everything CSV imports comes back as a string.
PSDrives and the Registry as a Filesystem
PowerShell's provider model makes the registry navigable with Get-ChildItem, cd, and Test-Path — except Get-ChildItem lists subkeys, not values, which looks like an empty key until you reach for Get-ItemProperty instead.
Terminating vs Non-Terminating Errors
A try/catch around a missing-file error does nothing by default — most cmdlet errors in PowerShell are non-terminating, and catch only ever sees the terminating kind.
Modules, Export-ModuleMember, and -WhatIf
Every function in a .psm1 is public by default — a helper meant to stay internal leaks out silently until Export-ModuleMember says otherwise. Then: CmdletBinding, -Verbose, and SupportsShouldProcess.
PowerShell Remoting over SSH: Invoke-Command, Sessions, and $using:
Run PowerShell on other machines over SSH: Invoke-Command to one host or many, $using: for local values, persistent sessions, and why results lose methods.
Advanced
Production-grade patterns for experienced engineers
Background Jobs and ForEach-Object -Parallel
Time four one-second tasks run in sequence and in parallel, see an outer variable turn into $null in the parallel block, and pass values in with $using:.
A System Inventory Report: Putting the Pipeline to Work
Build a real automation script from Get-CimInstance, a function with error handling, and JSON/CSV export — and watch the same nested-object flattening from the CSV lesson show up again, on data that actually matters this time.
PowerShell Remoting at Scale: Jobs, Per-Host Errors, Files, and the Second Hop
Remoting across a fleet: -AsJob with a host that is down, per-host errors, copying files through a session, implicit remoting and the second-hop problem.