Skip to content

Latest commit

 

History

History
152 lines (125 loc) · 3.7 KB

RegistryValues.adoc

File metadata and controls

152 lines (125 loc) · 3.7 KB

DSC Resource 'RegistryValues'

RegistryValues provides a mechanism to manage registry keys and values on a target node.

Source

DSC Resource

Documentation

Table 1. Attributes of category 'RegistryValues'
Parameter Attribute DataType Description Allowed Values

Values

Mandatory

Hashtable[]

List of registry values

Table 2. Attributes of category 'RegistryValues/Values'
Parameter Attribute DataType Description Allowed Values

Key

Key

String

The path of the registry key to add, modify, or remove.
This path must include the registry hive/drive (e.g. HKEY_LOCAL_MACHINE:, HKLM:).

ValueName

Key

String

The name of the registry value.
To add or remove a registry key, specify this property as an empty string without specifying ValueType or ValueData. To modify or remove the default value of a registry key, specify this property as an empty string while also specifying ValueType or ValueData.

Ensure

String

Specifies whether or not the registry key or value should exist.
To add or modify a registry key or value, set this property to Present.
To remove a registry key or value, set this property to Absent.

  • Present (default)

  • Absent

ValueData

String[]

The data the specified registry key value should have as a string or an array of strings (MultiString only).

ValueType

String

The type the specified registry key value should have.

  • String

  • Binary

  • DWord

  • QWord

  • MultiString

  • ExpandString

Hex

Boolean

Specifies whether or not the specified DWord or QWord registry key data is provided in a hexadecimal format.
Not valid for types other than DWord and QWord.

  • True

  • False (default)

Force

Boolean

Specifies whether or not to overwrite the specified registry key value if it already has a value or whether or not to delete a registry key that has subkeys.

  • True

  • False (default)

Example
RegistryValues:
  Values:
    - Key: HKLM:\Software\Microsoft\Rpc\Internet
      ValueName: Ports
      ValueData: 60000-60100
      ValueType: MultiString
      Ensure: Present
      Force: true

    - Key: HKLM:\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging
      ValueName: EnableModuleLogging
      ValueData: 1
      ValueType: Dword

    - Key: HKLM:\Software\Policies\Microsoft\Cryptography\Configuration\SSL\00010002
      ValueName: EccCurves
      ValueData:
        - curve25519
        - NistP256
        - NistP384
      ValueType: MultiString

    - Key: HKLM:\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames
      Ensure: Absent
Recommended Lookup Options in Datum.yml (Excerpt)
lookup_options:

  RegistryValues:
    merge_hash: deep
  RegistryValues\Values:
    merge_hash_array: UniqueKeyValTuples
    merge_options:
      tuple_keys:
        - Key
        - ValueName