Get‑RegistryPropertyValue - dsccommunity/DscResource.Common GitHub Wiki

SYNOPSIS

Returns the value of the property specified in the Name parameter.

SYNTAX

Get-RegistryPropertyValue [-Path] <String> [-Name] <String> 
 [<CommonParameters>]

DESCRIPTION

Returns the value of the property specified in the Name parameter at the location provided in the Path parameter.

EXAMPLES

EXAMPLE 1

Get-RegistryPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\RS' -Name 'RS'

Returns the value of the property RS at the specified path.

EXAMPLE 2

Get-RegistryPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\RS' -Name 'RS' -ErrorAction 'Stop'

Returns the value of the property RS at the specified path, and throws an exception if either that path or the name does not exist.

EXAMPLE 3

Get-RegistryPropertyValue -Path 'HKCU:\SOFTWARE\Microsoft\Wisp\Touch' -Name 'Friction' -ErrorAction 'SilentlyContinue'

Returns the value of the property Friction at the specified path, and suppresses any errors that may occur if the path or the name does not exist.

PARAMETERS

-Name

Specifies the name of the property to return the value for.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Specifies the path where to look for the specified property name.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.String

NOTES

This function is similar to Get-ItemPropertyValue, but this command will honor the -ErrorAction parameter which Get-ItemPropertyValue does not. This command will by default not throw an exception and instead return $null if the specified property name does not exist.

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️