mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 05:17:44 +02:00
Update check-ping.ps1 and check-vpn.ps1
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user