Get-NetFirewallProfile
Set-NetFirewallProfile -Enabled False
Set-NetFirewallProfile -Enabled True
To create a firewall rule to allow SQL Server access on the default port...
New-NetFirewallRule -Name "SQL Inbound" -Description "SQL Inbound" -DisplayName "SQL Inbound" -Enabled True -Profile Domain,Public,Private -Direction Inbound -Action Allow -Protocol TCP -LocalPort 1433