To delete the registry key using PowerShell, we can use the Remove-Item command. Remove-Item command removes the registry key from the path specified. For example, we have the registry key name NodeSoftware stored at the path HKLM, under the Software key.
To delete the key we will use the below command.
Remove-Item -Path HKLM:\SOFTWARE\NodeSoftware -Force -Verbose
We can also use the Get-Item command to retrieve the Key name and then use the Remove-Item after pipeline.
Get-Item HKLM:\SOFTWARE\NodeSoftware | Remove-Item -Force -Verbose