17 lines
325 B
PowerShell
17 lines
325 B
PowerShell
|
$ErrorActionPreference = 'silentlycontinue'
|
||
|
$fwenabled = (get-netfirewallprofile -policystore activestore).Enabled
|
||
|
|
||
|
if ($fwenabled.Contains('True')) {
|
||
|
Write-Output "Firewall is Enabled"
|
||
|
netsh advfirewall show currentprofile
|
||
|
exit 0
|
||
|
}
|
||
|
|
||
|
|
||
|
else {
|
||
|
Write-Host "Firewall is Disabled"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
|
||
|
Exit $LASTEXITCODE
|