Disclaimer: Code is not mine but forgot where I got it. Ping me if this is yours and you will receive full kudos to it :)
function Test-Key([string]$path, [string]$key)
{
if(!(Test-Path $path)) { return $false }
if ((Get-ItemProperty $path).$key -eq $null) { return $false }
return $true
}