Reading Default Values

by Apr 2, 2010

Each registry key has a default value. It is called (default) when you look into regedit. To read this default value, you can just use this name (and put it into quotes). For example, use this line to find out the currently associated program for PowerShell scripts:

Get-ItemProperty Registry::HKEY_CLASSES_ROOT\.ps1 '(Default)' |
Select-Object -ExpandProperty '(default)'

Twitter This Tip! ReTweet this Tip!