From afbd9305e395f762802dc6cdd2016c57a95c2de4 Mon Sep 17 00:00:00 2001 From: Juha Karjalainen Date: Fri, 18 Jan 2019 12:17:12 +0200 Subject: Fix provisioning failure when unsetting proxy with no proxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When unset-proxy.ps1 script is run when there is no proxy set unset script fails leading provisioning to fail. Now will check if proxy is set before removing registery keys for it. Task-number: QTQAINFRA-2311 Change-Id: Ic50bcebc634bb90385ca817dac9bed24e9e897ec Reviewed-by: Tony Sarajärvi --- coin/provisioning/common/windows/unset-proxy.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/coin/provisioning/common/windows/unset-proxy.ps1 b/coin/provisioning/common/windows/unset-proxy.ps1 index 9c3dddb3..0b7d761f 100644 --- a/coin/provisioning/common/windows/unset-proxy.ps1 +++ b/coin/provisioning/common/windows/unset-proxy.ps1 @@ -38,6 +38,11 @@ $dcs = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ $dcs[8] = $_ -band 0xF7 Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" -Name DefaultConnectionSettings -Value $dcs Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0 -Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer -Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride +if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer){ + Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer + +} +if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride){ + Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride +} -- cgit v1.2.3