proxy_bypass_local
Различия
Показаны различия между двумя версиями страницы.
| Следующая версия | Предыдущая версия | ||
| proxy_bypass_local [2022/12/07 15:58] – создано user | proxy_bypass_local [2025/11/06 14:21] (текущий) – внешнее изменение 127.0.0.1 | ||
|---|---|---|---|
| Строка 1: | Строка 1: | ||
| + | ====== Enable Disable Proxy Settings via PowerShell. ====== | ||
| + | |||
| + | " | ||
| + | |||
| [[https:// | [[https:// | ||
| + | |||
| + | |||
| + | win_set_proxy_server_powershell.ps1 | ||
| + | |||
| + | < | ||
| + | #### | ||
| + | # SET-INTERNETPROXY | ||
| + | # | ||
| + | # DESCRIPTION | ||
| + | # This function will set the proxy server and (optional) Automatic configuration script. | ||
| + | # | ||
| + | # SYNTAX | ||
| + | # | ||
| + | # | ||
| + | # EXAMPLES | ||
| + | # Set-InternetProxy -proxy " | ||
| + | # Set-InternetProxy -proxy " | ||
| + | # Set-InternetProxy -proxy " | ||
| + | # Set-InternetProxy -proxy " | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # SOURCE | ||
| + | # | ||
| + | #### | ||
| + | |||
| + | Function Set-InternetProxy | ||
| + | { | ||
| + | [CmdletBinding()] | ||
| + | Param( | ||
| + | [Parameter(Mandatory=$True, | ||
| + | [String[]]$Proxy, | ||
| + | |||
| + | [Parameter(Mandatory=$False, | ||
| + | [AllowEmptyString()] | ||
| + | [String[]]$acs | ||
| + | ) | ||
| + | |||
| + | Begin | ||
| + | { | ||
| + | $regKey=" | ||
| + | } | ||
| + | | ||
| + | Process | ||
| + | { | ||
| + | Set-ItemProperty -path $regKey ProxyEnable -value 1 | ||
| + | Set-ItemProperty -path $regKey ProxyServer -value $proxy | ||
| + | Set-ItemProperty -path $regKey ProxyOverride -value "< | ||
| + | |||
| + | if($acs) | ||
| + | { | ||
| + | Set-ItemProperty -path $regKey AutoConfigURL -Value $acs | ||
| + | } | ||
| + | } | ||
| + | | ||
| + | End | ||
| + | { | ||
| + | Write-Output "Proxy is now enabled" | ||
| + | Write-Output "Proxy Server : $proxy" | ||
| + | if ($acs) | ||
| + | { | ||
| + | Write-Output " | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | Write-Output " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | # Keep this line and make sure there is an empty line below this one | ||
| + | </ | ||
proxy_bypass_local.1670417933.txt.gz · Последнее изменение: (внешнее изменение)
