You can use "netsh advfirewall firewall" commands to view rules. And you can use "netsh exec" to execute a script to modify rules. Unfortunately the "dump" command is not implemented, so there is some work involved to turn the "show rule" output into a script.
https://technet.microsoft.com/en-us/library/dd734783%28v=ws....