From 7b6f2b7cc215180289bbba4390951f9021529445 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Tue, 25 Oct 2022 14:58:55 +0200 Subject: [PATCH] Update check-vpn.ps1 --- Scripts/check-vpn.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/check-vpn.ps1 b/Scripts/check-vpn.ps1 index e8aa2d0d..76df2bda 100755 --- a/Scripts/check-vpn.ps1 +++ b/Scripts/check-vpn.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS - Checks the VPN connection(s) + Checks the VPN connection .DESCRIPTION This PowerShell script queries and prints the status of any VPN connection. .EXAMPLE @@ -12,17 +12,17 @@ #> try { - $FoundOne = $false + $NoVPN = $true if ($IsLinux) { # TODO } else { $Connections = (Get-VPNConnection) foreach($Connection in $Connections) { - "✅ VPN $($Connection.Name) is $($Connection.ConnectionStatus)." - $FoundOne = $true + "✅ VPN '$($Connection.Name)' is $($Connection.ConnectionStatus)." + $NoVPN = $false } } - if (!$FoundOne) { "⚠️ No VPN connection." } + if ($NoVPN) { "⚠️ No VPN connection." } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"