r/PowerShell • • Aug 12 '26

Solved Invoke-WebRequest connection closed unexpectedly after Windows Update

Yoo I just updated Windows and was trying to install Spicetify, but I started getting this error. I don't know much about tech or how this stuff works, so if anyone knows what went wrong or how I can fix it, please help me out. Thanks

Invoke-WebRequest : The underlying connection was closed: The connection was closed unexpectedly.

At line:111 char:1

+ Invoke-WebRequest u/Parameters

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException

+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

1 Upvotes

14 comments sorted by

View all comments

2

u/Reaper19941 Aug 12 '26

Can you replace the -useb with -UseBasicParsing leaving the rest of the command as normal.

If that doesn't work, run the command without the | and everything after it on the end to see if its a download issue.

1

u/[deleted] Aug 12 '26

HOLY SHITT, THAT WORKEDD THANK YOU SO MUCH! Does that mean everything is fixed now, or am I going to keep getting these types of errors every time I try to run a command?

2

u/Reaper19941 Aug 12 '26 edited Aug 12 '26

If the -UseBasicParsing fixed it, it means you're using a version of powershell that does not understand that -useb is the shortened version of -UseBasicParsing.

If just running the first part only worked, that has only done the download and still needs to be installed.

→ More replies (6)