Install-RegistryKey

Creates a registry key. If it already exists, does nothing.

Syntax

Install-RegistryKey [-Path] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Given the path to a registry key, creates the key and all its parents. If the key already exists, nothing happens.

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String

The path to the registry key to create.

true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

EXAMPLE 1

Install-RegistryKey -Path 'hklm:\Software\Carbon\Test'

Creates the hklm:\Software\Carbon\Temp registry key if it doesn't already exist.