I posted this on the Q&A for the module, but figured I’d ask here just in case someone already has a workaround…
I’m trying to use the xNetworking module to set Firewall rules on Windows 2008 R2 but keep getting this error: The term ‘Get-NetFirewallRule’ is not recognized as the name of a cmdlet, function, script file, or operable program. From what I can see, the Get-NetFirewallRule cmdlet isn’t available until Win8/2012, so I’m guessing I need to work something out with NETSH.
I have written a DSC Resource to set Firewall rules on Windows Server 2008 R2 as I ran into the same problem. I’ve got some detail around the resource on my blog, see link below. I haven’t covered the Set-TargetResource or Test-TargetResource bits yet, but happy to provide the resource if you’d like it. (and yes, this blog hasn’t been updated in a few months … I need to get back onto that!)