How to turn the Windows Firewall On or Off Via the Command Line.

Windows Firewall

Via Command.exe

Turn Off
netsh advfirewall set allprofiles state off
Turn On
netsh advfirewall set allprofiles state on

Via Powershell

Turn Off
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
Turn On
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True

,