title: Powershell - get-Itemproperty into array
body: <p>I am working on a powershell script to find all the Component registry keys, which have a Data Key under them of "00004109F100C0400000000000F01FEC".  The following powershell returns the results that I want, however I am expecting "$test" to be an array so I can loop through each value.  In the below code it is not and I can't figure out why.</p>
  
  <pre><code>$test = @()
  $test = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\ | ForEach-Object { (Get-ItemProperty $_.pspath -Name "00004109F100C0400000000000F01FEC" -ErrorAction SilentlyContinue).PSPath }
  </code></pre>
  
  <p>How can I modify the above to get the results in $test to be an array of Component keys that I can loop though?</p>