Yes, you can remove the subkeys recursively using it. I am explaining in details:
Get-ChildItem
can perform complex filtering capabilities
Get-ChildItem -Path "HKLM:\SOFTWARE\Sonicwall -Recurse
would help you to atleast list down all the items that you want to delete.
The next thing you can do after confirming is pipe it further to Remove-item
. That way you know what is being deleted.
You can remove contained items by using Remove-Item
, but you will be prompted to confirm the removal if the item contains anything else.
Remove-Item -Path HKLM:\SOFTWARE\Sonicwall
This item has children and since you have not given -recurse. So you need to choose according to the options that would prompt.
However, if you do not wish to get the prompt and delete first all the items within but the HKLM:\SOFTWARE\Sonicwall, then what you can do is :
Remove-Item -Path HKLM:\SOFTWARE\Sonicwall\* -Recurse
Since you are looking for removal in one single shot with subkeys and everything, then you can use -Force
for the same:
Remove-Item -Path HKLM:\SOFTWARE\Sonicwall -recurse -Force
Hope it gives you some idea on what you should be doing next.