You can set Firewall Rules in PowerShell by using different NetFirewallRule cmdlets. For example, if you want to create a new Firewall Rule, you have to use the New-NetFirewallRule cmdlet.