PowerShell: searching the registry

psreg01

psreg02

No access to the Security path – fine:

psreg03

cd to Software to see what is there:

psreg04

We are specifically interested in Microsoft stuff…

psreg05

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:

psreg06

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.:

psreg08

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}}

psreg09

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

psreg10

 

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

 

Advertisements

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