Add Windows PowerShell installer/updater
This commit is contained in:
@ -13,11 +13,12 @@
|
|||||||
$ZabbixServer = "zabbix.server-nb.de" # Zabbix-Server-Adresse
|
$ZabbixServer = "zabbix.server-nb.de" # Zabbix-Server-Adresse
|
||||||
$ZabbixVersion = "7.4.2" # Zabbix-Version (bei neuen Releases anpassen)
|
$ZabbixVersion = "7.4.2" # Zabbix-Version (bei neuen Releases anpassen)
|
||||||
|
|
||||||
# Proxy-Liste – hier manuell pflegen
|
# Proxy-Liste – hier manuell pflegen (Name und URL)
|
||||||
$ProxyList = @(
|
$ProxyList = @(
|
||||||
"http://proxy01.example.com:3128"
|
@{ Name = "Standort Büro A"; Url = "http://proxy01.example.com:3128" }
|
||||||
"http://proxy02.example.com:3128"
|
@{ Name = "Standort Büro B"; Url = "http://proxy02.example.com:3128" }
|
||||||
# weitere Proxys einfach hier eintragen
|
# weitere Proxys einfach hier eintragen:
|
||||||
|
# @{ Name = "Rechenzentrum"; Url = "http://proxy03.example.com:3128" }
|
||||||
)
|
)
|
||||||
|
|
||||||
# Installationspfade (normalerweise nicht ändern nötig)
|
# Installationspfade (normalerweise nicht ändern nötig)
|
||||||
@ -47,7 +48,8 @@ function Get-InstalledVersion {
|
|||||||
-ErrorAction SilentlyContinue |
|
-ErrorAction SilentlyContinue |
|
||||||
Where-Object { $_.DisplayName -like "Zabbix Agent 2*" } |
|
Where-Object { $_.DisplayName -like "Zabbix Agent 2*" } |
|
||||||
Select-Object -First 1
|
Select-Object -First 1
|
||||||
return $reg?.DisplayVersion
|
if ($null -ne $reg) { return $reg.DisplayVersion }
|
||||||
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── Proxy-Auswahl ─────────────────────────────────────────────────────────────
|
# ── Proxy-Auswahl ─────────────────────────────────────────────────────────────
|
||||||
@ -56,7 +58,7 @@ function Select-Proxy {
|
|||||||
Write-Host "Proxy-Einstellungen:" -ForegroundColor Cyan
|
Write-Host "Proxy-Einstellungen:" -ForegroundColor Cyan
|
||||||
Write-Host " [0] Kein Proxy (direkte Verbindung)"
|
Write-Host " [0] Kein Proxy (direkte Verbindung)"
|
||||||
for ($i = 0; $i -lt $ProxyList.Count; $i++) {
|
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 ""
|
Write-Host ""
|
||||||
|
|
||||||
@ -67,7 +69,7 @@ function Select-Proxy {
|
|||||||
if ($choice -eq "0") {
|
if ($choice -eq "0") {
|
||||||
return $null
|
return $null
|
||||||
} else {
|
} else {
|
||||||
return $ProxyList[[int]$choice - 1]
|
return $ProxyList[[int]$choice - 1].Url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user