How to delete registry Key using PowerShell?


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

Updated on: 31-Oct-2023

43K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements