Когда я запускаю curl
(Invoke-Webrequest
) внутренний URL, я получаю следующую ошибку
curl scm.intra
curl : Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
At line:1 char:1
+ curl scm.intra
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ConfigurationErrorsException
+ FullyQualifiedErrorId : System.Configuration.ConfigurationErrorsException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
То же самое, когда я запускаю
[System.Net.WebRequest]::DefaultWebProxy
Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
At line:1 char:1
+ [System.Net.WebRequest]::DefaultWebProxy
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ConfigurationErrorsException
+ FullyQualifiedErrorId : System.Configuration.ConfigurationErrorsException
Я понял, что когда я выполните команду curl
, там значение ProxyServer
в реестре переопределено. Итак, у меня есть это
$ Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
DisableCachingOfSSLPages : 1
IE5_UA_Backup_Flag : 5.0
PrivacyAdvanced : 1
SecureProtocols : 160
User Agent : Mozilla/4.0 (compatible; MSIE 8.0; Win32)
CertificateRevocation : 1
AutoConfigURL : http://webproxy.intra:1234/files/proxy.pac
ProxyEnable : 1
EnableAutodial : 1
NoNetAutodial : 1
EnableHTTP1_1 : 1
ProxyHTTP1.1 : 1
ShowPunycode : 0
EnablePunycode : 1
UrlEncoding : 0
DisableIDNPrompt : 0
EnableNegotiate : 1
WarnonBadCertRecving : 1
WarnonZoneCrossing : 1
WarnOnPostRedirect : 1
ZonesSecurityUpgrade : {111, 140, 10, 129...}
MigrateProxy : 1
ProxyServer : webproxy.sc.intra:8080
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion
PSChildName : Internet Settings
PSDrive : HKCU
PSProvider : Microsoft.PowerShell.Core\Registry
После запуска curl scm.intra
я получаю это
curl scm.intra
curl : Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section.
At line:1 char:1
+ curl scm.intra
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ConfigurationErrorsException
+ FullyQualifiedErrorId : System.Configuration.ConfigurationErrorsException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
, которое переопределяет ProxyServer
с неправильным значением
$ Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
...
ProxyServer : http:\\:webproxy.intra:8080
...
Где это неправильное значение? Как правильно настроить прокси-сервер для Powershell.