From 3d6b8700bd9f1e9d76a9012543dade4b87d708da Mon Sep 17 00:00:00 2001 From: dyoder Date: Fri, 22 May 2020 16:20:37 -0400 Subject: [PATCH] update --- Install-ManagementAgent.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Install-ManagementAgent.ps1 b/Install-ManagementAgent.ps1 index b6f2099..4774a20 100644 --- a/Install-ManagementAgent.ps1 +++ b/Install-ManagementAgent.ps1 @@ -30,13 +30,16 @@ If ( $CUSTOMER_ID ) } ## Download the agent installer - Try { (New-Object System.Net.WebClient).DownloadFile($AGENT_URL, $AGENT_INSTALLER) } - Catch { Write-Output "There was an error downloading the agent installer!"; Exit } + Try + { + [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} + (New-Object System.Net.WebClient).DownloadFile($AGENT_URL, $AGENT_INSTALLER) + } + Catch { Write-Output "There was an error downloading the agent installer!" } ## Install the agent Try { Start-Process $AGENT_INSTALLER -ArgumentList '/quiet /passive' -Wait } Catch { Write-Output "There was an error installing the agent!" } - New-Item -Path $Env:SYSTEMDRIVE -Name "ready-for-install" -ItemType "file" -Value "" ## Remove the agent installer If ( Test-Path $AGENT_INSTALLER )