title: Get-ChildItem pipeline into ForEach-Object Get-ItemProperty - $_ path concatenates Current Working Dir with HKLM registry path?
body: <p>I've checked a few answers here and found that this seems to be a common problem but none of the suggestions were working for me. </p>
  
  <p>When I do </p>
  
  <pre><code>Get-ChildItem "Microsoft.PowerShell.Core\Registry::HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\"
  </code></pre>
  
  <p>It returns what is expected, a list of all the registry keys ("thingys") in that registry location ("registry folder thingy"), namely the network adapters in my machine (including hidden ones). </p>
  
  <p>Now I want to not just dump everything into the output, just the <code>DriverDesc</code> value for each of those keys, i.e. "Intel(R) Dual Band Wireless-AC 7265" and some weird "Microsoft ISATAP Adapter" names as well. </p>
  
  <p>Pipelining this command into a ForEach-Object Get-ItemProperty party seems like the ideal solution, however when I try that I get a weird error: </p>
  
  <pre><code>Get-ChildItem "Microsoft.PowerShell.Core\Registry::HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\" | ForEach-Object {Get-ItemProperty $_.Name}
  </code></pre>
  
  <p>Error: </p>
  
  <pre><code>Get-ItemProperty : Cannot find path 'C:\Users\Folder\Powershell\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0000' because it does not exist. 
  At line:1 char:155
  </code></pre>
  
  <p>It seems that the pipeline doohickey is concatenating my current working directory with the HKLM registry path and trying to access that registry key, which of course doesn't exist. </p>
  
  <p>To be sure the piplining isn't being weird, I tried to just write the names out:</p>
  
  <pre><code>Get-ChildItem "Microsoft.PowerShell.Core\Registry::HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\" | ForEach-Object {Write-Host $_.Name}
  </code></pre>
  
  <p>And the results were what I expected: </p>
  
  <pre><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0000
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0001
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\0002
  </code></pre>
  
  <p>But the problem seems to be that the path provider gets dropped in the pipeline party and Get-ItemProperty doesn't handle it. </p>