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

Welcome Forums General PowerShell Q&A Remove Registry Item -- Can't get any cmdlets to work

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
4 years, 4 months ago.

  • Author
    Posts
  • #16373

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1
    Rank: Member

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

  • #16377

    Participant
    Points: 0
    Rank: Member

    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".

The topic ‘Remove Registry Item -- Can't get any cmdlets to work’ is closed to new replies.