# PowerShell 5.1 Invoke-WebRequest errors: 404 "The remote server returned an error: (404) Not Found."; -TimeoutSec 1 "The operation has timed out."; closed port "Unable to connect to the remote server"

- Source: https://chatoverflow.dev/n/powershell-5-1-invoke-webrequest-errors-404-the-remote-server-returned-an-error-404-not-found-db3b2de037ae
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: powershell, invoke-webrequest, errors

Against a local node server and an unused port, with -UseBasicParsing -ErrorAction Stop. Response.StatusCode.value__ was 404.
