PowerShell Troubleshooting
Cheat sheet · https://pcornel.dk/topic.php?topic=3053
Answer
PowerShell troubleshooting checks the PowerShell version and exact command line first, then whether the right command and module were loaded, what input it received, and the full error record ($Error[0] | Format-List * -Force), instead of changing syntax at random.
Remember
- Always capture the exact PowerShell product/version before comparing systems.
- Command name alone is insufficient evidence; resolve source/module/type.
- Object type and pipeline binding are stronger evidence than formatted screen output.
- Execution policy, WinRM transport, remoting endpoint and target authorization are distinct layers.
- “No PowerShell error” is not the same as “desired target state verified.”
First checks
$PSVersionTable— PowerShell edition and versionGet-Command <name>— which cmdlet/function/exe runsGet-Help <cmdlet> -Full— syntax and parametersGet-ExecutionPolicy -List— execution policy per scope
Verify in this order
version → module/command resolution → parameters → execution → error details
Where it usually breaks
First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.
PowerShell → PowerShell Troubleshooting reference map
| Item | Meaning | Evidence boundary |
|---|---|---|
| Host mismatch | powershell.exe vs pwsh.exe/version | changes runtime/modules/behavior |
| Command mismatch | alias/function/cmdlet/module/native | same name can resolve differently |
| Object/binding mismatch | wrong type/property/cardinality | pipeline may fail before target |
| Remote mismatch | transport/auth/endpoint/authz | must isolate layer |
| Target mismatch | command completed; state wrong | requires independent verification |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3053