I have a Windows Server 2019 instance that used to have a proxy server configured in its proxy setting but has since been disabled from Proxy Settings -> Proxy
If I run the powershell 5.1 command:
Invoke-WebRequest https://<LOCALURL>
then i'm still directed though the previously configured proxy and my request is denied. If I run the same command though powershell 7.2 then it works as expected.
I've made the following changes to try to rid any residual proxy configurations but nothing has worked.
- Disabled MigrateProxy: hcu\software\microsoft\windows\currentversion\internet settings\MigrateProxy: Changed from 1 to 0
- netsh winhttp import proxy source=ie
- netsh winhttp reset proxy
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -Type String -Value ""
- Searched and combed for proxy values in the registry
- Restarted numerous times
Where is powershell 5.1 still pulling the removed proxy configuration from??
You can make sure that you don't have anything in your DefaultConnectionSettings, which is a byte array and has to be parsed, but you can check that for the current user and local machine keys, and that may be causing you grief: