Skip to content

Remove Reg Key

Raymond Piller edited this page Apr 20, 2018 · 4 revisions

You can also add a registry key ...

Remove a registry key with RegistryPlus:

RegistryPlus Remove_Key
{
    Ensure = 'Absent'
    Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Test'
}

This is doable, with Registry. However, I believe it feels a bit clunky and have asked for the rogue ValueName to be removed. Here's how you would do it with Registry:

Registry Remove_Key
{
    Ensure = 'Absent'
    Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Test'
    ValueName = ''
}

With RegistryPlus, we just build the above Registry configuration for you before compiling the MOF. Keeping your files cleaner, and requiring no additional modules be installed on each of your clients.

Clone this wiki locally