Powershell switch ie proxy

Source: Internet
Author: User

I bought a proxy that passes through the firewall. It is troublesome to manually set the proxy in windows. Finally, I tried powershell constantly and finally succeeded.

In fact, using powershell to set the IE proxy is to change the registry, first paste the code: $ enableproxy = Get-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings "-name proxyenable
If ($ enableproxy. proxyenable-EQ 1)
{
Write-host "ie proxy is disabled"
Set-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings"-name "proxyenable"-value 0
Set-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings"-name "autoconfigurl"-value ""
}
Else
{
Write-host "ie proxy is enabled"
Set-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings"-name "proxyenable"-value 1

# Proxy method 1: automatically configure scripts and
Set-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings"-name "autoconfigurl"-value "http: // 121.199.52.48: 3389/sample/111.pac"

# Proxy Method 2: Set Proxy Server
# Set-itemproperty-path "hkcu: \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings"-name "proxyserver"-value "192.168.75.80: 808"
}

Sleep 3 attributes of IE in the registry can be edited in total:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.