title: How to query registry values skipping the PS* ones
body: <p>When querying the registry value names like this:</p>
  
  <pre><code>Get-ItemProperty HKCU:\Software\Microsoft\Osk
  </code></pre>
  
  <p>You get a whole bunch of extra values.</p>
  
  <pre><code>PSPath            : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft\Osk
  PSParentPath      : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\Microsoft
  PSChildName       : Osk
  PSDrive           : HKCU
  PSProvider        : Microsoft.PowerShell.Core\Registry
  WindowLeft        : 100
  WindowTop         : 100
  WindowWidth       : 828
  WindowHeight      : 236
  ClickSound        : 1
  Mode              : 1
  HoverPeriod       : 1000
  ScanInterval      : 1000
  UseDevice         : 1
  UseMouse          : 0
  UseKB             : 1
  ScanKey           : 32
  UseTextPrediction : 1
  InsertSpace       : 1
  ShowNumPad        : 0
  </code></pre>
  
  <p>What I want is only the value names (<code>WindowLeft</code>, ...)</p>
  
  <p>How can I do that?</p>
  
  <p><strong>Edit:</strong> string matches don't cut it. I do want legitimate registry value names to be included.</p>
  
  <p>Example (could have done similar things with <code>reg query hklm /v PS* /s</code> or <code>reg query hkcu /v PS* /s</code></p>
  
  <pre><code>reg add "HKCU\Software\BeSharp.net\Test" /v "Foo" /t REG_SZ /d "Bar" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "Bar" /t REG_SZ /d "Foo" /f
  
  reg add "HKCU\Software\BeSharp.net\Test" /v "PSPath" /t REG_SZ /d "Foo" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "PSParentPath" /t REG_SZ /d "Foo" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "PSChildName" /t REG_SZ /d "Foo" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "PSDrive" /t REG_SZ /d "Foo" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "PSProvider" /t REG_SZ /d "Foo" /f
  
  reg add "HKCU\Software\BeSharp.net\Test" /v "1" /t REG_SZ /d "PSPath" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "2" /t REG_SZ /d "PSParentPath" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "3" /t REG_SZ /d "PSChildName" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "4" /t REG_SZ /d "PSDrive" /f
  reg add "HKCU\Software\BeSharp.net\Test" /v "5" /t REG_SZ /d "PSProvider" /f
  
  reg query "HKCU\Software\BeSharp.net\Test"
  </code></pre>
  
  <p>You can delete the above demo data with this:</p>
  
  <pre><code>reg delete "HKCU\Software\BeSharp.net\Test"
  </code></pre>
  
  <p>The <code>reg query "HKCU\Software\BeSharp.net\Test"</code> returns this:</p>
  
  <pre><code>HKEY_CURRENT_USER\Software\BeSharp.net\Test
      Foo    REG_SZ    Bar
      Bar    REG_SZ    Foo
      PSPath    REG_SZ    Foo
      PSParentPath    REG_SZ    Foo
      PSChildName    REG_SZ    Foo
      PSDrive    REG_SZ    Foo
      PSProvider    REG_SZ    Foo
      1    REG_SZ    PSPath
      2    REG_SZ    PSParentPath
      3    REG_SZ    PSChildName
      4    REG_SZ    PSDrive
      5    REG_SZ    PSProvider
  </code></pre>
  
  <p>But the <code>PowerShell Get-ItemProperty "HKCU:\Software\BeSharp.net\Test"</code> returns this, overwriting the <code>PS*</code> values in the registry:</p>
  
  <pre><code>PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\BeSharp.net\Test
  PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software\BeSharp.net
  PSChildName  : Test
  PSDrive      : HKCU
  PSProvider   : Microsoft.PowerShell.Core\Registry
  Foo          : Bar
  Bar          : Foo
  1            : PSPath
  2            : PSParentPath
  3            : PSChildName
  4            : PSDrive
  5            : PSProvider
  </code></pre>
  
  <p>And adding a <code>Select</code> clause skips all <code>PS*</code> values, even if they came from the registry: <code>PowerShell Get-ItemProperty "HKCU:\Software\BeSharp.net\Test" ^| Select * -Exclude PS*</code>:</p>
  
  <pre><code>Foo : Bar
  Bar : Foo
  1   : PSPath
  2   : PSParentPath
  3   : PSChildName
  4   : PSDrive
  5   : PSProvider
  </code></pre>
  
  <p>So: skip PS* values like <code>PSPath</code>, <code>PSParentPath</code>, <code>PSChildName</code>, <code>PSDrive</code> and <code>PSProvider</code> (are there more?) when they are not in the registry, but include them when they are in the registry.</p>
  
  <p>Bonus: Only list the names (not the values).</p>