how to Enable these Windows Firewall rules using powershell?
You would use the Enable-NetFirewallRule cmdlet:

Enable-NetFirewallRule -Name "WMI-WINMGMT-In-TCP", "WMI-RPCSS-In-TCP"


In order to find the relevant rule names (in order to enable it), you can search existing firewall rules by name by using the Get-NetFirewallRule cmdlet, for example:

Get-NetFirewallRule -Name "*WMI*"


This uses wildcards to final all the rules that contain "WMI" as an example.