question

ProkashSinha-7975 avatar image
0 Votes"
ProkashSinha-7975 asked DSPatrick edited

On Windows 7 VMware client Powershell error for Firewall rules delete

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-7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

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://docs.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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.