From 4d9467716d335b119e1bad0442e0584833b938db Mon Sep 17 00:00:00 2001 From: smo Date: Tue, 25 Mar 2025 17:25:39 +0000 Subject: [PATCH] Update remove-aovpn.ps1 --- remove-aovpn.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/remove-aovpn.ps1 b/remove-aovpn.ps1 index dc15449..05de9c9 100644 --- a/remove-aovpn.ps1 +++ b/remove-aovpn.ps1 @@ -12,8 +12,15 @@ Start-Sleep -Seconds 5 # Try to remove the VPN connection try { - Remove-VpnConnection -AllUserConnection -Name "Staedion AoVPN-D" -Force - Remove-VpnConnection -Name "Staedion AoVPN-U" -Force + Remove-VpnConnection -AllUserConnection -Name "Staedion AoVPN-D" -Force -ErrorAction Stop + Write-Output "VPN connection successfully removed." +} +catch { + Write-Error "Error removing the VPN connection: $_" +} + +try { + Remove-VpnConnection -Name "Staedion AoVPN-U" -Force -ErrorAction Stop Write-Output "VPN connection successfully removed." } catch {