Read registry settings recursively with Powershell
<p>I'm trying to read recursively some registry settings with Powershell.
This is what I tried:</p>

<pre><code>$registry = Get-ChildItem "HKLM:\Software\Wow6432Node\EODDashBoard\moveFilesOverflow" -Recurse
Foreach($a in $registry) {
    Write-Output $a.PSChildName
    $subkeys = (Get-ItemProperty  $a.pspath)
    Write-Output $subkeys.LastDateTime_EndScript

}
</code></pre>

<p>I would like to be able to list all the registry keys with their value, without knowning the registry keys. </p>

<p>With my script I have a variable $subkeys that contains objects I can access. (For example here I can access <code>$subkeys.LastDateTime_EndScript</code>)</p>

<p>However what I would like is to list all the registry keys with their value without knowing the registry keys in my script, ie something like this:</p>

<pre><code>Foreach ($subkey in $subkeys) {
    Write-Output $subkey.keyname
    Write-Output $subkey.value
}
</code></pre>

<p>Is it possible?
Thanks,</p>