---
title: "Ensure Registry Key"
---
Ensures that a registry key exists or does not exist.
Windows::Ensure-RegistryKey(
[Exists: <true/false>],
[DefaultValue: <text>],
Hive: <integer>,
Key: <text>
);
| Name | Format | Script Usage | Usage Notes |
|---|---|---|---|
| Exists | true/false | Exists | Default value is "True". |
| Default value | text | DefaultValue | A key's default value is the legacy unnamed value that every registry key may have. This is rarely used. |
| ☆ Hive | integer | Hive | This argument is required. |
| ☆ Key | text | Key | This argument is required. |
Windows::Ensure-RegistryKey
(
Hive: LocalMachine,
Key: SOFTWARE\Inedo\BuildMaster
);