Skip to content

Instantly share code, notes, and snippets.

@famousgarkin
Last active July 24, 2024 17:04
Show Gist options
  • Save famousgarkin/c5138b1e13ac41920d22 to your computer and use it in GitHub Desktop.
Save famousgarkin/c5138b1e13ac41920d22 to your computer and use it in GitHub Desktop.

Revisions

  1. famousgarkin renamed this gist Apr 14, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. famousgarkin renamed this gist Apr 12, 2016. 1 changed file with 0 additions and 0 deletions.
  3. famousgarkin renamed this gist Dec 1, 2015. 1 changed file with 0 additions and 0 deletions.
  4. famousgarkin renamed this gist Oct 14, 2015. 1 changed file with 0 additions and 0 deletions.
  5. famousgarkin renamed this gist Mar 6, 2015. 1 changed file with 0 additions and 0 deletions.
  6. famousgarkin renamed this gist Mar 6, 2015. 1 changed file with 0 additions and 0 deletions.
  7. famousgarkin revised this gist Mar 6, 2015. 3 changed files with 24 additions and 23 deletions.
    9 changes: 0 additions & 9 deletions Clear-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -1,9 +0,0 @@
    # IE 8 (may vary for other versions)
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 0
    Set-ItemProperty -Path $path -Name ProxyServer -Value ""
    Set-ItemProperty -Path $path -Name ProxyOverride -Value ""

    # env
    [Environment]::SetEnvironmentVariable("http_proxy", $null, "User")
    [Environment]::SetEnvironmentVariable("https_proxy", $null, "User")
    14 changes: 0 additions & 14 deletions Set-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -1,14 +0,0 @@
    $server = ""
    $port = ""

    $proxy = "http://" + $server + ":" + $port

    # IE 8 (may vary for other versions)
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 1
    Set-ItemProperty -Path $path -Name ProxyServer -Value $proxy
    Set-ItemProperty -Path $path -Name ProxyOverride -Value "<local>"

    # env
    [Environment]::SetEnvironmentVariable("http_proxy", $proxy, "User")
    [Environment]::SetEnvironmentVariable("https_proxy", $proxy, "User")
    24 changes: 24 additions & 0 deletions powershell proxy set clear
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # NOTE: registry keys for IE 8, may vary for other versions
    $regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings'

    function Clear-Proxy
    {
    Set-ItemProperty -Path $regPath -Name ProxyEnable -Value 0
    Set-ItemProperty -Path $regPath -Name ProxyServer -Value ''
    Set-ItemProperty -Path $regPath -Name ProxyOverride -Value ''

    [Environment]::SetEnvironmentVariable('http_proxy', $null, 'User')
    [Environment]::SetEnvironmentVariable('https_proxy', $null, 'User')
    }

    function Set-Proxy
    {
    $proxy = 'http://example.com'

    Set-ItemProperty -Path $regPath -Name ProxyEnable -Value 1
    Set-ItemProperty -Path $regPath -Name ProxyServer -Value $proxy
    Set-ItemProperty -Path $regPath -Name ProxyOverride -Value '<local>'

    [Environment]::SetEnvironmentVariable('http_proxy', $proxy, 'User')
    [Environment]::SetEnvironmentVariable('https_proxy', $proxy, 'User')
    }
  8. famousgarkin revised this gist Nov 24, 2014. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion Clear-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # IE 8
    # IE 8 (may vary for other versions)
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 0
    Set-ItemProperty -Path $path -Name ProxyServer -Value ""
    2 changes: 1 addition & 1 deletion Set-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ $port = ""

    $proxy = "http://" + $server + ":" + $port

    # IE 8
    # IE 8 (may vary for other versions)
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 1
    Set-ItemProperty -Path $path -Name ProxyServer -Value $proxy
  9. famousgarkin revised this gist Nov 24, 2014. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion Clear-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # IE
    # IE 8
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 0
    Set-ItemProperty -Path $path -Name ProxyServer -Value ""
    2 changes: 1 addition & 1 deletion Set-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ $port = ""

    $proxy = "http://" + $server + ":" + $port

    # IE
    # IE 8
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 1
    Set-ItemProperty -Path $path -Name ProxyServer -Value $proxy
  10. famousgarkin created this gist Nov 24, 2014.
    9 changes: 9 additions & 0 deletions Clear-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # IE
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 0
    Set-ItemProperty -Path $path -Name ProxyServer -Value ""
    Set-ItemProperty -Path $path -Name ProxyOverride -Value ""

    # env
    [Environment]::SetEnvironmentVariable("http_proxy", $null, "User")
    [Environment]::SetEnvironmentVariable("https_proxy", $null, "User")
    14 changes: 14 additions & 0 deletions Set-Proxy.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    $server = ""
    $port = ""

    $proxy = "http://" + $server + ":" + $port

    # IE
    $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    Set-ItemProperty -Path $path -Name ProxyEnable -Value 1
    Set-ItemProperty -Path $path -Name ProxyServer -Value $proxy
    Set-ItemProperty -Path $path -Name ProxyOverride -Value "<local>"

    # env
    [Environment]::SetEnvironmentVariable("http_proxy", $proxy, "User")
    [Environment]::SetEnvironmentVariable("https_proxy", $proxy, "User")