By default, the Get-NetFirewallProfile cmdlet returns all Firewall profiles — Domain, Private, and Public. So, by sending the output of this to Set-NetFirewallProfile, we can either disable or enable all profiles at once. It is also possible to select a specified profile using the -Name parameter.

Like this:

About the author: Ravikanth C

Ravikanth is the founder and editor of the PowerShell Magazine. He is also a PowerShell MVP who works at Dell Inc. He blogs at http://www.ravichaganti.com/blog and you can follow him on Twitter @ravikanth.