Pcornel
Windows · PowerShell

PowerShell Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=3053

Back to the Topic

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 version
  • Get-Command <name> — which cmdlet/function/exe runs
  • Get-Help <cmdlet> -Full — syntax and parameters
  • Get-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

ItemMeaningEvidence boundary
Host mismatchpowershell.exe vs pwsh.exe/versionchanges runtime/modules/behavior
Command mismatchalias/function/cmdlet/module/nativesame name can resolve differently
Object/binding mismatchwrong type/property/cardinalitypipeline may fail before target
Remote mismatchtransport/auth/endpoint/authzmust isolate layer
Target mismatchcommand completed; state wrongrequires 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

Confirmation

Confirm action

Continue?