If you would like to test whether a certain registry key exists, you should remember that all registry keys are treated like folders on a drive, so they have a path. Test-Path can check whether they exist:
Test-Path HKCU:\Software\Testkey
If you would like to test whether a certain registry key exists, you should remember that all registry keys are treated like folders on a drive, so they have a path. Test-Path can check whether they exist: