Tests if a registry value exists.
Test-RegistryKeyValue [-Path] <String> [-Name] <String> [<CommonParameters>]
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.
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 |
Test-RegistryKeyValue -Path 'hklm:\Software\Carbon\Test' -Name 'Title'
Returns True
if hklm:\Software\Carbon\Test
contains a value named 'Title'. False
otherwise.