Skip to content

Instantly share code, notes, and snippets.

@corani
Created January 15, 2015 06:10
Show Gist options
  • Save corani/4b32e3c3fade6e8cf685 to your computer and use it in GitHub Desktop.
Save corani/4b32e3c3fade6e8cf685 to your computer and use it in GitHub Desktop.
Automatically set proxy configuration
$flip = (Get-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections' -Name DefaultConnectionSettings).DefaultConnectionSettings
$flip[8] = "3"
Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections' -Name DefaultConnectionSettings -Value $flip
Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyEnable -Value 1
Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyOverride -Value "<local>"
Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name ProxyServer -Value "<server>:<port>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment