1

I'm new to powershell and thought I'd start practicing.

I've created a new key in Registry Editor. Now, I'm trying to access this data from the Get-ChildItems commands.

I specifically want the Email within the Property column and hopefully save it as a string variable, see Powershell Output

The above output is shown when the below command is executed:

Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Sort'

So far, I've tried (to no avail): ~

$PropertyObject = Get-ChildItem -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Sort' | Select-Object Property

Write-Host $PropertyObject

This only lists the directory names, and not the content.

Please help?

mklement0
  • 382,024
  • 64
  • 607
  • 775

1 Answers1

0

Instead of using Get-ChildItem, use the Get-ItemPropertyValue cmdlet.

Get-ItemPropertyValue -Path $Path -Name Email
mklement0
  • 382,024
  • 64
  • 607
  • 775