Update check-ping.ps1 and check-vpn.ps1

This commit is contained in:
Markus Fleschutz 2022-10-10 08:37:10 +02:00
parent 3375e6db6e
commit 78232dacf7
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ try {
$Avg += $Latency
}
$Avg = $Avg / $Pings.count
"✅ Ping is $($Avg)ms average ($($Min)ms min, $($Max)ms max)."
"✅ Ping is $($Avg)ms average, $($Min)ms minimum, $($Max)ms maximum."
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -15,12 +15,12 @@ try {
$FoundOne = $false
$Connections = (Get-VPNConnection)
foreach($Connection in $Connections) {
"VPN $($Connection.Name) is $($Connection.ConnectionStatus)."
"VPN $($Connection.Name) is $($Connection.ConnectionStatus)."
$FoundOne = $true
}
if (!$FoundOne) { throw "No VPN connection available" }
if (!$FoundOne) { "⚠️ No VPN connection configured" }
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}