title: How to get registryKey name alone instead of full registry keypath?
body: <p>I was trying to get all the sub registry keys from registry key</p>
  
  <pre><code>$Key="hklm:\SOFTWARE\Wow6432Node\MyCompany\MyProj"
  $ComponentKeys=Get-ChildItem -path $Key 
  $ComponentName=$Components | Select-object Name
  $ComponentName
  </code></pre>
  
  <p>It displays the result like below</p>
  
  <pre><code>Name
  ----
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Service
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\UserInterface
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\DataSetView
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Notification
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Model
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyCompany\MyProj\Management
  </code></pre>
  
  <p>But I just would like to retrieve the subkey name not the full name.</p>
  
  <p>I need result like below</p>
  
  <pre><code>Name
  ----
  Service
  UserInterface
  DataSetView
  Notification
  Model
  Management
  </code></pre>
  
  <p>How to get the key name alone?</p>