Check PowerShell Version Before Running Scripts - Fix 502 Bad Gateway from Command Line-Repair PowerShell Installation Using DISM: Step-by-Step Guide

Final checklist
- Confirm that the same symptom is gone after a restart or refresh.
- Keep the smallest working change and undo temporary diagnostic settings.