move certificate verification outside try block
This commit is contained in:
@@ -30,11 +30,8 @@ If ( $CUSTOMER_ID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Download the agent installer
|
## Download the agent installer
|
||||||
Try
|
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
|
||||||
{
|
Try { (New-Object System.Net.WebClient).DownloadFile($AGENT_URL, $AGENT_INSTALLER) }
|
||||||
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
|
|
||||||
(New-Object System.Net.WebClient).DownloadFile($AGENT_URL, $AGENT_INSTALLER)
|
|
||||||
}
|
|
||||||
Catch { Write-Output $_.Exception.Message ; Exit }
|
Catch { Write-Output $_.Exception.Message ; Exit }
|
||||||
|
|
||||||
## Install the agent
|
## Install the agent
|
||||||
|
|||||||
Reference in New Issue
Block a user