PSScriptTools
PSScriptTools copied to clipboard
Invoke-WebRequest using Net.WebRequest instead of Net.Http.HttpClient
Beginning with PowerShell 6, PowerShell began to use Net.Http.HttpClient for Invoke-WebRequest instead of Net.WebRequest. Unfortunately, it would seem that this was a pretty massive downgrade. Even just a basic Invoke-WebRequest "https://postman-echo.com/get?i=test" is twice as slow as it is on PS5.
Aside from being useful for later PowerShell versions, it could have some QoL like making Accept-Encoding include deflate and gzip by default and checking the header before downloading to see if the incoming data is going to be binary or text.