17
Feb
2010
Author: paul
In: Scripting
Do you need to shuttle around to different places? If so, then this script may be of use to you.
Every customer’s site uses different proxy settings. Don’t you find it a chore having to keep changing the settings manually? If the answer is yes, then this script will definitely brighten up your day! This script has now become one of my “Most Popular Script” in my notebook.
1: switch ($args[0])
2: {
3: Site1 { $proxyServer = 'proxy1.sg:8080'; $proxyEnable = 1 }
4: Site2 { $proxyServer = 'proxy2.sg:8080'; $proxyEnable = 1 }
5: default { $proxyServer = ''; $proxyEnable = 0 }
6: }
7:
8: # Write-Output $proxyServer
9: # Write-Output $proxyEnable
10:
11: set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -value $proxyEnable
12: set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -value $proxyServer
48e17ba2-b107-47d4-b2bb-2d30df9e67f7|2|5.0