Update Win_Firewall_Check_Status.ps1
This commit is contained in:
parent
4766477c58
commit
1236d55544
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue