Test whether Registry Key exists

by Apr 7, 2010

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

Twitter This Tip! ReTweet this Tip!