PowerShell Automation
Cheat sheet · https://pcornel.dk/topic.php?topic=5228
Answer
PowerShell automation uses cmdlets, pipelines of objects, functions, modules and remoting to manage Windows, Active Directory, Microsoft 365, Azure, VMware and more from scripts that run on Windows, Linux and macOS.
Remember
- PowerShell passes objects, not text.
- Use -WhatIf before bulk changes.
- Set $ErrorActionPreference = 'Stop' so try/catch works.
First checks
$PSVersionTable— PowerShell version/editionInvoke-ScriptAnalyzer -Path . -Recurse— lintInvoke-Pester— tests
Verify in this order
script → cmdlets/objects → remoting → targets
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
PowerShell Automation · PowerShell operational reference
| Boundary | PowerShell Automation reference |
|---|---|
| Runtime identity | PowerShell edition/version + command/module source |
| Persistent intent | Script/module/config prerequisites under source control |
| Verification | Read-only discovery → execution evidence → independent target read-back |
| Output contract | Structured objects/streams before formatting |
| Failure boundary | Separate engine/binding from transport/API/native and target-state failures |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5228