WinRM
Cheat sheet · https://pcornel.dk/topic.php?topic=5242
Answer
WinRM is the Windows service behind PowerShell Remoting, listening on 5985 for HTTP and 5986 for HTTPS. Enable it with Enable-PSRemoting and restrict access with firewall rules and TrustedHosts only when needed.
Remember
- WinRM listens on 5985 (HTTP) and 5986 (HTTPS).
- Enable-PSRemoting configures it.
- TrustedHosts is needed outside a domain without HTTPS.
First checks
winrm enumerate winrm/config/listener— listenersTest-NetConnection <host> -Port 5985— HTTP portwinrm get winrm/config/service— service settings
Verify in this order
client → 5985/5986 → WinRM service → PowerShell
Where it usually breaks
Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.
WinRM · PowerShell operational reference
| Boundary | WinRM 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=5242