Remove-ItemProperty

Delete a property and its value from an item. This cmdlet can delete registry values and the data that they store.

Syntax
      Remove-ItemProperty { [-path] string[] | [-literalPath] string[] }
         [[-name] string[]] [-include string[]] [-exclude string[]]
            [-filter string] [-force] [-whatIf] [-confirm]
                [-credential PSCredential] [-UseTransaction] [CommonParameters]

Key
   -Path string
       The path(s) to the item whose properties are being removed.
       Wildcards are permitted.

   -LiteralPath string
       Like Path above, only the value is used exactly as typed.
       No characters are interpreted as wildcards. If the path includes any
       escape characters then enclose the path in single quotation marks.

   -Name string
       The name(s) of the property to be retrieved.

   -Include string
       Delete only the specified items from the Path e.g. "May*"
       this only works when the path includes a wildcard character.
        
   -Exclude string
       Omit the specified items from the Path e.g. "*SS64*"
       this only works when the path includes a wildcard character.
        
   -Filter string
       A filter in the provider's format or language. 
       The exact syntax of the filter (wildcard support etc) depends on the provider.
       Filters are more efficient than -include/-exclude, because the provider
       applies the filter when retrieving the objects, rather than having 
       PowerShell filter the objects after they are retrieved.

   -WhatIf
       Describe what would happen if you executed the command without
       actually executing the command.
        
   -Confirm
       Prompt for confirmation before executing the command.

   -Credential PSCredential
       Use a credential to validate access to the file. Credential represents
       a user-name, such as "User64" or "Domain64\User64", or a PSCredential
       object, such as one retrieved by Get-Credential.
       If you type a user name, you will be prompted for a password.

   -UseTransaction
       Include the command in the active transaction.

Standard Aliases for Remove-ItemProperty: rp

Remove-ItemProperty deletes a property and its value from an item. You can use it to delete registry values and the data that they store.

Examples

Delete the 'Demo' registry value, and its data, from HKEY_LOCAL_MACHINE\Software\SS64

PS C:\> Remove-itemproperty -path HKLM:\Software\SS64 -name Demo

Delete the 'Demo' registry value, but this time by changing location, and using a dot (.) to indicate the current location:

PS C:\> Set-location HKLM:\Software\SS64
PS HKLM:\Software\SS64> Remove-itemproperty -path . -Name Demo

“He that filches from me my good name Robs me of that, which not enriches him, And makes me poor indeed” ~ Shakespeare (Othello)

Related PowerShell Cmdlets

Clear-ItemProperty - Delete the value of a property.
Copy-ItemProperty - Copy a property along with its value.
Get-ItemProperty - Retrieve the properties of an object.
Move-ItemProperty - Move a property from one location to another.
New-ItemProperty - Set a new property of an item at a location.
Remove-Item - Remove an item.
Rename-ItemProperty - Rename a property of an item.
Set-ItemProperty - Set the value of a property.


 
Copyright © 1999-2024 SS64.com
Some rights reserved