mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-25 17:33:17 +01: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 = $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])"
|
||||
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user