Querying a registry property whose name is starting with a *

Francois 176 Reputation points
2020-10-13T18:44:20.913+00:00

Hi,

I am trying to query that registry value:

Get-ChildItem "hklm:\SYSTEM\ControlSet001\Control\Class" -Recurse -ErrorAction SilentlyContinue | % {Get-ItemProperty $_.pspath} -ErrorAction SilentlyContinue | ? {$_.*EEE} -ErrorAction SilentlyContinue

My issue is the property name is: *EEE so my command is not returning the value. Just failing. How may I workaround that issue?

Thanks

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,629 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 47,601 Reputation points
    2020-10-13T18:54:52.977+00:00

    Have you tried protecting the property name?

    Like this: $_.'*EEE'

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.