Инструменты пользователя

Инструменты сайта


proxy_bypass_local

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
proxy_bypass_local [2022/12/07 15:58] – создано userproxy_bypass_local [2025/11/06 14:21] (текущий) – внешнее изменение 127.0.0.1
Строка 1: Строка 1:
 +====== Enable Disable Proxy Settings via PowerShell. ======
 +
 +"powershell Set-Internet Proxy BypassProxyOnLocal"
 +
 [[https://gist.github.com/hygorluz/3c856da994cbc4e48c3ca08d27e021cc|Внешняя ссылка]] [[https://gist.github.com/hygorluz/3c856da994cbc4e48c3ca08d27e021cc|Внешняя ссылка]]
 +
 +
 +win_set_proxy_server_powershell.ps1
 +
 +<code>
 +####
 +# SET-INTERNETPROXY
 +#
 +# DESCRIPTION
 +#   This function will set the proxy server and (optional) Automatic configuration script.
 +#
 +# SYNTAX
 +#   Set-InternetProxy [-Proxy] <string[]> [[-acs] <string[]> [<CommonParameters>]
 +#
 +# EXAMPLES 
 +#        Set-InternetProxy -proxy "http=127.0.0.1:8080"
 +#        Set-InternetProxy -proxy "https=127.0.0.1:8080"
 +#        Set-InternetProxy -proxy "ftp=127.0.0.1:8080"
 +#        Set-InternetProxy -proxy "socks=127.0.0.1:8080"
 +#   Setting proxy information and (optinal) Automatic Configuration Script:
 +#       Set-InternetProxy -proxy "proxy:7890" -acs "http://proxy:7892" 
 +#
 +# SOURCE
 +#   https://gallery.technet.microsoft.com/scriptcenter/PowerShell-function-Get-cba2abf5
 +####
 +
 +Function Set-InternetProxy
 +{
 +    [CmdletBinding()]
 +    Param(        
 +        [Parameter(Mandatory=$True,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
 +        [String[]]$Proxy,
 +
 +        [Parameter(Mandatory=$False,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
 +        [AllowEmptyString()]
 +        [String[]]$acs                
 +    )
 +
 +    Begin
 +    {
 +            $regKey="HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"        
 +    }
 +    
 +    Process
 +    {        
 +        Set-ItemProperty -path $regKey ProxyEnable -value 1
 +        Set-ItemProperty -path $regKey ProxyServer -value $proxy   
 +        Set-ItemProperty -path $regKey ProxyOverride -value "<local>"                    
 +                         
 +        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 "Automatic Configuration Script : $acs"
 +        }
 +        else
 +        {            
 +            Write-Output "Automatic Configuration Script : Not Defined"
 +        }
 +    }
 +}
 +
 +# Keep this line and make sure there is an empty line below this one
 +</code>
proxy_bypass_local.1670417933.txt.gz · Последнее изменение: (внешнее изменение)

Если не указано иное, содержимое этой вики предоставляется на условиях следующей лицензии: CC Attribution 4.0 International
CC Attribution 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki