Get‑RegistryPropertyValue - dsccommunity/DscResource.Common GitHub Wiki
Returns the value of the property specified in the Name parameter.
Get-RegistryPropertyValue [-Path] <String> [-Name] <String>
[<CommonParameters>]
Returns the value of the property specified in the Name parameter at the location provided in the Path parameter.
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.
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.
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.
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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
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.