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

This topic contains 2 replies, has 2 voices, and was last updated by  Karson Van Meeteren 4 years, 1 month ago.

  • Author
  • #16373

    Karson Van Meeteren

    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?


  • #16374

    Don Jones

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

  • #16377

    Karson Van Meeteren

    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.