title: PowerShell Script to Remove Registry Item
body: <p>I'm trying to make a PowerShell script that checks a set registry key for a range of names that start the same. That part I have working fine. I also need this script to than remove those items from that registry and I am having trouble remembering how to pass the names of all items I find so that Remove-ItemProperty will work. This is what I have.</p>
  
  <pre><code>$Reg = 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Devices'
  
  
  Get-ItemProperty -Path $Reg | Select-Object IS* | ForEach-Object {$PSItem.Name} | Remove-ItemProperty -Path $Reg -Name $name
  </code></pre>
  
  <p>The message I get is that Name is null so I'm not storing the names correctly. They display correctly if I just run the first two pipes.</p>