From 1236d555449bca20eb731298f0f4c390554763a2 Mon Sep 17 00:00:00 2001 From: sdm216 <62703673+sdm216@users.noreply.github.com> Date: Mon, 28 Jun 2021 14:48:22 -0400 Subject: [PATCH] Update Win_Firewall_Check_Status.ps1 --- scripts/Win_Firewall_Check_Status.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/Win_Firewall_Check_Status.ps1 b/scripts/Win_Firewall_Check_Status.ps1 index 07ebfbf4..50a105d2 100644 --- a/scripts/Win_Firewall_Check_Status.ps1 +++ b/scripts/Win_Firewall_Check_Status.ps1 @@ -1,17 +1,17 @@ $ErrorActionPreference = 'silentlycontinue' $fwenabled = (get-netfirewallprofile -policystore activestore).Enabled -if ($fwenabled.Contains('True')) { - Write-Output "Firewall is Enabled" +if ($fwenabled.Contains('False')) { + Write-Output "Firewall is Disabled" + exit 1 +} + + +else { + Write-Host "Firewall is Enabled" netsh advfirewall show currentprofile exit 0 } -else { - Write-Host "Firewall is Disabled" - exit 1 -} - - -Exit $LASTEXITCODE \ No newline at end of file +Exit $LASTEXITCODE