I also see a great deal of repeatative text that could be consolidated greatly reducing the size of your script and potentially improving readability.
For example you use long registry keys repeatedly. Try using a variable.
instead of:
code:
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyHttp1.1", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "EnableHttp1.1", "00000000", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MigrateProxy", "00000001", "REG_DWORD")
$Dummy = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "hoffexc:80", "REG_MULTI_SZ")
use code:
$Key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
one time and reference $Key in multiple lines.