Update Win_Firewall_Check_Status.ps1

This commit is contained in:
sdm216 2021-06-28 14:48:22 -04:00 committed by GitHub
parent 4766477c58
commit 1236d55544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -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
Exit $LASTEXITCODE