Skip to content

Commit

Permalink
feat: Add proxy support for windows recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
rthorn-nr committed Mar 3, 2023
1 parent 558a673 commit de1dec9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion recipes/newrelic/apm/dotNet/windows-iis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ install:
}
catch {}
$WebClient = New-Object System.Net.WebClient
if ($env:HTTPS_PROXY) {
$WebClient.Proxy = New-Object System.Net.WebProxy($env:HTTPS_PROXY, $true)
}
try {
(New-Object System.Net.WebClient).DownloadFile("{{.NEW_RELIC_DOWNLOAD_URL}}dot_net_agent/latest_release/NewRelicDotNetAgent_x64.msi", "$env:TEMP\NewRelicDotNetAgent_x64.msi")
$WebClient.DownloadFile("{{.NEW_RELIC_DOWNLOAD_URL}}dot_net_agent/latest_release/NewRelicDotNetAgent_x64.msi", "$env:TEMP\NewRelicDotNetAgent_x64.msi")
}
catch {
$baseException = $_.Exception.GetBaseException()
Expand Down
6 changes: 5 additions & 1 deletion recipes/newrelic/infrastructure/ohi/sql/ms-sql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ install:
}
# Installing MSSql Integration
(New-Object System.Net.WebClient).DownloadFile("http://download.newrelic.com/infrastructure_agent/windows/integrations/nri-mssql/nri-mssql-amd64.msi", "$env:TEMP\nri-mssql-amd64.msi");
$WebClient = New-Object System.Net.WebClient
if ($env:HTTPS_PROXY) {
$WebClient.Proxy = New-Object System.Net.WebProxy($env:HTTPS_PROXY, $true)
}
$WebClient.DownloadFile("http://download.newrelic.com/infrastructure_agent/windows/integrations/nri-mssql/nri-mssql-amd64.msi", "$env:TEMP\nri-mssql-amd64.msi");
msiexec.exe /qn /i "$env:TEMP\nri-mssql-amd64.msi" | Out-Null;
Restart-Service newrelic-infra
Expand Down
7 changes: 6 additions & 1 deletion recipes/newrelic/infrastructure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,13 @@ install:
}
catch {}
$WebClient = New-Object System.Net.WebClient
if ($env:HTTPS_PROXY) {
$WebClient.Proxy = New-Object System.Net.WebProxy($env:HTTPS_PROXY, $true)
}
try {
(New-Object System.Net.WebClient).DownloadFile("{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/windows/newrelic-infra.msi", "$env:TEMP\newrelic-infra.msi")
$WebClient.DownloadFile("{{.NEW_RELIC_DOWNLOAD_URL}}infrastructure_agent/windows/newrelic-infra.msi", "$env:TEMP\newrelic-infra.msi")
}
catch {
$baseException = $_.Exception.GetBaseException()
Expand Down

0 comments on commit de1dec9

Please sign in to comment.