PowerShell: searching the registry



No access to the Security path – fine:


cd to Software to see what is there:


We are specifically interested in Microsoft stuff…


Rather than walk all of Software, let’s query each individually for a string we want, and it could be in key value or data:


gci -Path . -Recurse -Filter "*Hazel*"
gci : Cannot call method. The provider does not support the use of filters.

That’s a shame. OK. So I need to get each node, and then query within that. Like this, where “usa” is the (case-insensitive) wildcard search string.:


That did enough to prove the principle for me. I can then look for the string I actually want… “hazel” ( this in a Speech Synthesis context):

Get-ChildItem . -rec -ea SilentlyContinue | % { if ((Get-ItemProperty -Path $_.PsPath) -match "hazel") { $_.PsPath}}


That is not bad, but be aware that it eats CPU:



We are not done, as I also need to test for Get-Item / Name.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s