Automation · PowerShell Automation
Modules
Cheat sheet · https://pcornel.dk/topic.php?topic=5235
Answer
PowerShell modules package functions, cmdlets and resources (.psm1 with a .psd1 manifest), installed from the PowerShell Gallery with Install-Module and loaded with Import-Module.
Remember
- Modules package functions (.psm1) with a manifest (.psd1).
- Install-Module installs from the PowerShell Gallery.
- Pin versions with -RequiredVersion.
First checks
Get-Module -ListAvailable <name>— installedInstall-Module <name> -Scope CurrentUser— install (PSGallery)Import-Module <name> -RequiredVersion <v>— pin version
Verify in this order
module → manifest → imported commands
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
Modules · PowerShell operational reference
| Boundary | Modules 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=5235