Documentation

win_regedit - Add, Edit, or Remove Registry Keys and Values

New in version 2.0.

Synopsis

Add, Edit, or Remove Registry Keys and Values using ItemProperties Cmdlets

Options

parameter required default choices comments
data
no
    Registry Value Data
    datatype
    no string
    • binary
    • dword
    • expandstring
    • multistring
    • string
    • qword
    Registry Value Data Type
    key
    yes
      Name of Registry Key
      state
      no present
      • present
      • absent
      State of Registry Value
      value
      yes
        Name of Registry Value

        Examples

        # Creates Registry Key called MyCompany.
        win_regedit:
          key: HKCU:\Software\MyCompany
        
        # Creates Registry Key called MyCompany,
        # a value within MyCompany Key called "hello", and
        # data for the value "hello" containing "world".
        win_regedit:
          key: HKCU:\Software\MyCompany
          value: hello
          data: world
        
        # Creates Registry Key called MyCompany,
        # a value within MyCompany Key called "hello", and
        # data for the value "hello" containing "1337" as type "dword".
        win_regedit:
          key: HKCU:\Software\MyCompany
          value: hello
          data: 1337
          datatype: dword
        
        # Delete Registry Key MyCompany
        # NOTE: Not specifying a value will delete the root key which means
        # all values will be deleted
        win_regedit:
          key: HKCU:\Software\MyCompany
          state: absent
        
        # Delete Registry Value "hello" from MyCompany Key
        win_regedit:
          key: HKCU:\Software\MyCompany
          value: hello
          state: absent
        

        This is an Extras Module

        For more information on what this means please read Extras Modules

        For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.