public/Test-WpcDictionaryKey.ps1

function Test-WpcDictionaryKey {
    param(
        [System.Collections.IDictionary] $Dictionary,
        [string] $Key
    )

    if ($Dictionary -is [hashtable]) {
        return $Dictionary.ContainsKey($Key)
    }

    return $Dictionary.Contains($Key)
}