mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-08 17:28:18 +02:00
Update check-ping.ps1 and check-vpn.ps1
This commit is contained in:
parent
3375e6db6e
commit
78232dacf7
@ -36,7 +36,7 @@ try {
|
|||||||
$Avg += $Latency
|
$Avg += $Latency
|
||||||
}
|
}
|
||||||
$Avg = $Avg / $Pings.count
|
$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
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -15,10 +15,10 @@ try {
|
|||||||
$FoundOne = $false
|
$FoundOne = $false
|
||||||
$Connections = (Get-VPNConnection)
|
$Connections = (Get-VPNConnection)
|
||||||
foreach($Connection in $Connections) {
|
foreach($Connection in $Connections) {
|
||||||
"VPN $($Connection.Name) is $($Connection.ConnectionStatus)."
|
"✅ VPN $($Connection.Name) is $($Connection.ConnectionStatus)."
|
||||||
$FoundOne = $true
|
$FoundOne = $true
|
||||||
}
|
}
|
||||||
if (!$FoundOne) { throw "No VPN connection available" }
|
if (!$FoundOne) { "⚠️ No VPN connection configured" }
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user