In the image below, I am trying to delete “subkey”. However, a variety of cmdlets simply won’t work
I’ve tried:
Get-ChildItem -Path hklm:\Software\Microsoft\Windows\CurrentVersion\test* | remove-item
Get-item -Path hklm:\Software\Microsoft\Windows\CurrentVersion\test* | remove-item
Is there something obvious I am missing?
donj
June 19, 2014, 5:18am
2
I think that’s exposed as an ItemProperty - do a “Get-Command *ItemProperty” to see commands that work with those.
Thanks, Don. Looks like that’s the trick.
Remove-ItemProperty -Path hklm:\Software\Microsoft\Windows\CurrentVersion\test\ -Name * -WhatIf
What if: Performing the operation “Remove Property” on target “Item: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\test\ Property: subkey”.