Beginning in Windows 8 and Server 2012, there is a cmdlet that helps you enable the client firewall for various profiles:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True
In previous operating systems, you have to resort to netsh.exe:
netsh advfirewall set allprofiles state on