I am trying to write a simple script in PowerShell (trying to save it in one line) which will be:
- List all subkeys in a registry key recursively
- Find one that has a specific meaning
- Delete another value for the section found in the previous step
This is my code:
Get-ChildItem "HKLM:\Software\Microsoft\KeyToQuery" -Recurse | Where-Object {$_.ValueA -eq "True"}
Under "KeyToQuery" are several subsections of random names that contain the same value.
The first part of this work, but the Where-Object statement never evaluates to true. I also tried -match and-like to no avail.
Where am I going wrong?
source share