posts - 104 , comments - 115 , trackbacks - 0

Powershell Test Reg Key function

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
}

Print | posted on Wednesday, December 5, 2012 8:14 AM | Filed Under [ General Powershell ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: