Private/Get-uARegistryItem.ps1

Function Get-uARegistryItem {
    PARAM(
        [Parameter(Mandatory = $True, Position = 0)]
        [string]$Key
    )

    # Correct key path if not correct
    If (!($Key.substring(0, 10) -ieq 'Registry::')) {
        Write-Verbose "Add 'Registry::' at the beginning of '$Key'"
        $Key = 'Registry::' + "$Key"
    }

    # Get content
    If (Test-Path $Key) {
        Write-Verbose "'$Key' exists"
        # Test for subkeys
        If ((Get-ChildItem -Path $Key).count -gt 0) {
            # Found subkeys
            $Result = Get-ChildItem -Path $Key -Recurse
        }
        Else {
            # No subkeys
            $Result = Get-Item $Key
        }
    }
    Else {
        Write-Verbose "'$Key' does not exist"
        $Result = $Null
    }

    Return $Result
}
# SIG # Begin signature block
# MIIRVgYJKoZIhvcNAQcCoIIRRzCCEUMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDpPXqYz0BtkzTc
# eeoCrADve20+cDX1ga+r1TqlicsKi6CCDW0wggZyMIIEWqADAgECAghkM1HTxzif
# CDANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx
# EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8G
# A1UEAwwoU1NMLmNvbSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTAe
# Fw0xNjA2MjQyMDQ0MzBaFw0zMTA2MjQyMDQ0MzBaMHgxCzAJBgNVBAYTAlVTMQ4w
# DAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjERMA8GA1UECgwIU1NMIENv
# cnAxNDAyBgNVBAMMK1NTTC5jb20gQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBD
# QSBSU0EgUjEwggIiMA0GCSqGS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