DSCResources/ROACommon/Src/Get-LocalizableRegistryKeyValue.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function Get-LocalizableRegistryKeyValue {
<#
    .NOTES
        https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1
#>

    [CmdletBinding()]
    param (
        [Parameter()]
        [System.Object] $RegistryKey,

        [Parameter()]
        [System.String] $ValueName
    )
    process {

        $result = $RegistryKey.GetValue("{0}_Localized" -f $ValueName);
        if (-not $result) {
            
            $result = $RegistryKey.GetValue($ValueName);
        }
        return $result;

    }
} #end function Get-LocalizableRegistryKeyValue