Get-ChildItem returns a value I'm not interested in

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?

Hey Stian,

Try this :

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

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