SyntaxFix
Write A Post
Hire A Developer
Questions
The -not test should fire if a property doesn't exist:
-not
$prop = (Get-ItemProperty $regkey).$name if (-not $prop) { New-ItemProperty -Path $regkey -Name $name -Value "X" }