On Windows 7 VMware client Powershell error for Firewall rules delete

Prokash Sinha 81 Reputation points
2022-03-31T15:46:42.443+00:00

On the Host machine ( Windows 10 ) I Get downloaded all the command lets. But on Vmware workstation based VM ( Windows 7) I am not able to delete the persistent rules since the Ge-Command -- fails to download. Network connection is not an issue. PS is with Administrative power. Using RegEdit I clean the BFE keys under CurrentControlSet, when I reboot, reg entries are gone. But netsh wfp show filters creates the xml file with all the filters I added.

I add rules using WFP Api, and it does not show in the Defender Firewall App, so I can not delete from there.

Is there a way to clean all the rules from the VM ( Windows 7). So I can continue testing without old rules being shown ??
Thanks,
Prokash

PS C:\Users\Administrator> Get-Command -Module NetSecurity
PS C:\Users\Administrator> Remove-NetFirewallRule
Remove-NetFirewallRule : The term 'Remove-NetFirewallRule' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1

  • Remove-NetFirewallRule
  • ~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Remove-NetFirewallRule:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-04-18T07:45:46.937+00:00

    Hi,

    The Remove-NetFirewallRule cmdlet is from the NetSecurity module which is only available on Windows Server 2012 or later and cannot be installed on Windows 7.
    You can use netsh advfirewall firewall delete instead.

    https://learn.microsoft.com/en-us/powershell/module/netsecurity

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.