From 3b762c38ac0af475ec28548df2f8b507672aabe9 Mon Sep 17 00:00:00 2001 From: rpwolff Date: Fri, 20 Feb 2026 13:12:59 +0100 Subject: [PATCH] Add Windows PowerShell installer/updater --- install-update-zabbix-agent.ps1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/install-update-zabbix-agent.ps1 b/install-update-zabbix-agent.ps1 index 76ba54e..4b2c4dd 100644 --- a/install-update-zabbix-agent.ps1 +++ b/install-update-zabbix-agent.ps1 @@ -13,11 +13,12 @@ $ZabbixServer = "zabbix.server-nb.de" # Zabbix-Server-Adresse $ZabbixVersion = "7.4.2" # Zabbix-Version (bei neuen Releases anpassen) -# Proxy-Liste – hier manuell pflegen +# Proxy-Liste – hier manuell pflegen (Name und URL) $ProxyList = @( - "http://proxy01.example.com:3128" - "http://proxy02.example.com:3128" - # weitere Proxys einfach hier eintragen + @{ Name = "Standort Büro A"; Url = "http://proxy01.example.com:3128" } + @{ Name = "Standort Büro B"; Url = "http://proxy02.example.com:3128" } + # weitere Proxys einfach hier eintragen: + # @{ Name = "Rechenzentrum"; Url = "http://proxy03.example.com:3128" } ) # Installationspfade (normalerweise nicht ändern nötig) @@ -47,7 +48,8 @@ function Get-InstalledVersion { -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "Zabbix Agent 2*" } | Select-Object -First 1 - return $reg?.DisplayVersion + if ($null -ne $reg) { return $reg.DisplayVersion } + return $null } # ── Proxy-Auswahl ───────────────────────────────────────────────────────────── @@ -56,7 +58,7 @@ function Select-Proxy { Write-Host "Proxy-Einstellungen:" -ForegroundColor Cyan Write-Host " [0] Kein Proxy (direkte Verbindung)" for ($i = 0; $i -lt $ProxyList.Count; $i++) { - Write-Host " [$($i+1)] $($ProxyList[$i])" + Write-Host " [$($i+1)] $($ProxyList[$i].Name) – $($ProxyList[$i].Url)" } Write-Host "" @@ -67,7 +69,7 @@ function Select-Proxy { if ($choice -eq "0") { return $null } else { - return $ProxyList[[int]$choice - 1] + return $ProxyList[[int]$choice - 1].Url } }