Remove Registry Item -- Can't get any cmdlets to work

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Karson Van Meeteren Karson Van Meeteren 2 years, 5 months ago.

  • Author
    Posts
  • #16373
    Profile photo of Karson Van Meeteren
    Karson Van Meeteren
    Participant

    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?

    [IMG]http://i.imgur.com/RVjalQa.png[/IMG]

  • #16374
    Profile photo of Don Jones
    Don Jones
    Keymaster

    I think that's exposed as an ItemProperty – do a "Get-Command *ItemProperty" to see commands that work with those.

  • #16377
    Profile photo of Karson Van Meeteren
    Karson Van Meeteren
    Participant

    Thanks, Don. Looks like that's the trick.

    Remove-ItemProperty -Path hklm:\Software\Microsoft\Windows\CurrentVersion\test\ -Name *  -WhatIf 

    [i]What if: Performing the operation "Remove Property" on target "Item: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\test\ Property: subkey".[/i]

You must be logged in to reply to this topic.