Test-RegistryKeyValue

Tests if a registry value exists.

Syntax

Test-RegistryKeyValue [-Path] <String> [-Name] <String> [<CommonParameters>]

Description

The usual ways for checking if a registry value exists don't handle when a value simply has an empty or null value. This function actually checks if a key has a value with a given name.

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String

The path to the registry key where the value should be set. Will be created if it doesn't exist.

true false
Name String

The name of the value being set.

true false

EXAMPLE 1

Test-RegistryKeyValue -Path 'hklm:\Software\Carbon\Test' -Name 'Title'

Returns True if hklm:\Software\Carbon\Test contains a value named 'Title'. False otherwise.