Author Posts

January 27, 2015 at 9:04 am

Hi all!

I'm quite stuck here, trying to get Powershell to return value "Name" from registry. So far, so good.

gci $registrypath | ? {$_.Name -like "*Google*"}


    Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles


SKC  VC Name                           Property                                                                                        
---  -- ----                           --------                                                                                        
 10   0 emailaddress@mydomain.com - Goo... {}                                                                                              

On the other hand, if I'm trying to get the "Name" property from registry, I'm getting the full path to the registry value, and that's not what I want!

(gci $registrypath | ? {$_.Name -like "*Google*"}).Name

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\emailaddress@mydomain.com - Google Apps

All I want is this value: emailaddress@mydomain.com – Google Apps

What in the #### am I doing wrong here?

January 27, 2015 at 1:07 pm

Hey Stian,

Try this :

(gci $registrypath | ? {$_.Name -like "*Google*"}).PSChildName

January 28, 2015 at 3:10 am

Great, thanks! Thanks to you, I got introduced to the gm cmdlet 😀