Search notes:

PowerShell cmdLet Remove-ItemProperty

The PowerShell cmdlet remove-itemProperty removes deletes a property from an item (typically(?) a registry value).

Example: removing a value under a registry key

The following simple example uses new-item to create a registry key, then adds three values to that key and pauses (read-host) to check the registry.
After hitting enter, the value xyz is removed and the script pauses again to verify that the value was indeed remove.
Finally, the registry key is removed with remove-item.
$regKey = 'hkcu:\Software\tq84_removeItemTest'

$null = new-item $regKey

set-itemProperty $regKey  num   42
set-itemProperty $regKey  txt  'Hello world'
set-itemProperty $regKey  xyz  'Foo, bar, baz'

read-host 'Registry key and values created.'

remove-itemProperty $regKey xyz

read-host 'Value "xyz" removed.'

remove-item $regKey
Github repository about-PowerShell, path: /cmdlets/itemProperty/remove/registry-value.ps1

See also

The command parameter -credential.
Powershell command noun: itemProperty

Index