Update Win_Firewall_Check_Status.ps1
$ErrorActionPreference = 'silentlycontinue'
$fwenabled = (get-netfirewallprofile -policystore activestore).Enabled
-if ($fwenabled.Contains('True')) {
- Write-Output "Firewall is Enabled"
- netsh advfirewall show currentprofile
- exit 0
+if ($fwenabled.Contains('False')) {
+ Write-Output "Firewall is Disabled"
+ exit 1
}
else {
- Write-Host "Firewall is Disabled"
- exit 1
+ Write-Host "Firewall is Enabled"
+ netsh advfirewall show currentprofile
+ exit 0
}
