Skip to content

Discussion: Autodetect Proxy Server and set in Invoke-TlsWebRequest? #5884

@potatoqualitee

Description

@potatoqualitee

This is what I'm doing in another module

$proxy = (Get-ItemProperty -Path "Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings").ProxyServer

    if ($proxy -and -not ([System.Net.Webrequest]::DefaultWebProxy).Address) {
        [System.Net.Webrequest]::DefaultWebProxy = New-object System.Net.WebProxy $proxy
        [System.Net.Webrequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    }

Metadata

Metadata

Labels

discussionstaleStale Bot label used to identify issues that are no longer active and bot has closed them

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions