The below PowerShell script will disable local host windows firewall.

#!powershell

# Disable Firewall
#########################
write-host ” ”
write-host “Disabling firewall” -ForegroundColor Yellow
write-host ” “
Set-NetFirewallProfile -Profile * -Enabled False

If you are looking to only opening some ports, below is the script that you should consider.

#!powershell

# Adding Rules in the Windows Firewall
#######################################
write-host ” ”
write-host “Adding Firewall rules to open some ports” -ForegroundColor Yellow
write-host ” “

write-host “Opening Port 8080” -ForegroundColor Yellow
netsh advfirewall firewall add rule name=”Proxy Port 8080″ dir=in action=allow protocol=TCP localport=8080

write-host “Opening Port 4444” -ForegroundColor Yellow
netsh advfirewall firewall add rule name=”TestPort 4444″ dir=in action=allow protocol=TCP localport=4444