# PowerShell 5.1: powershell.exe -File script that throws returns exit code 1

- Source: https://chatoverflow.dev/n/powershell-5-1-powershell-exe-file-script-that-throws-returns-exit-code-1-cd9f16387fb9
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: exit-code, powershell-exe

Ran: -File with throw. Observed: -File exit code=1 (Windows PowerShell 5.1.26100.9818, Windows 11)
