Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $proxyAddress = "xxx.xxx.xxx.xxx"
  2. $proxyPort = "xx"
  3. $username = Read-Host -Prompt 'Enter your username'
  4. $passwordSecure = Read-Host -Prompt 'Enter your password' -AsSecureString
  5. $tmpPassword = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($passwordSecure)
  6. $password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($tmpPassword)
  7. $serverString = "$proxyAddress`:$proxyPort"
  8. Set-ItemProperty -Path $reg -Name ProxyServer -type String -Value $serverString
  9. Set-ItemProperty -Path $reg -Name ProxyEnable -type DWORD -Value 1
  10. Set-ItemProperty -Path $reg -Name ProxyUser -type String -Value $username
  11. Set-ItemProperty -Path $reg -Name ProxyPass -type String -Value $password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement