Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Synopsis
Retrieve registry configuration.
Important
The registry command and Microsoft.Windows/Registry resource are a proof-of-concept example
for use with DSCv3. Don't use it in production.
Syntax
registry config delete [OPTIONS] --input <INPUT>
Description
The delete command removes a registry key or value as an instance of the
Microsoft.Windows/Registry resource. It expects input as a JSON instance of the resource for the
--input option.
The input instance must define the keyPath property. It uses the keyPath value to determine
which registry key to operate on. If the input instance includes the valueName property, the
command remove that value instead of the registry key itself.
Examples
Example 1 - delete a registry value
The command returns the current state of the specified registry value as a single line of compressed JSON without any whitespace.
$instance = @{
keyPath = 'HKCU\Example\Key'
valueName = 'ExampleValue'
} | ConvertTo-Json
registry config delete --input $instance | ConvertFrom-Json | Format-List
Example 2 - delete a registry key
The command returns the current state of the specified registry key as a single line of compressed JSON without any whitespace.
$instance = @{
_exist = $true
keyPath = 'HKCU\Example\Key'
} | ConvertTo-Json
registry config delete --input $instance | ConvertFrom-Json | Format-List
Options
-i, --input
Specifies the resource instance to remove from the system.
The instance must be a string containing a JSON object that is valid for the resource's instance schema.
Type : string
Mandatory : true
LongSyntax : --input <INPUT>
ShortSyntax : -i <INPUT>
-h, --help
Displays the help for the current command or subcommand. When you specify this option, the application ignores all other options and arguments.
Type : boolean
Mandatory : false
LongSyntax : --help
ShortSyntax : -h