I’m putting together a relevance statement to collect Windows application information from the Uninstall keys in the registry. The information is there, but I need in a particular format.
(values "DisplayName" of it as string, values "Publisher" of it as string, values "DisplayVersion" of it as string) of keys of keys "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)
A: AutoHotkey 1.1.32.00, Lexikos, 1.1.32.00
A: Cisco AnyConnect Secure Mobility Client , ( Cisco Systems, Inc. ), 4.6.03049
A: Google Chrome, Google LLC, 79.0.3945.117
which I need to look like this:
AutoHotkey 1.1.32.00 (Lexikos)|1.1.32.00
Cisco AnyConnect Secure Mobility Client (Cisco Systems, Inc.)|4.6.03049
Google Chrome (Google LLC)|79.0.3945.117
(or “DisplayName + space + open paren + Publisher + close paren + pipe + Version”)
The problems I’m running into are several:
- How can I work
unique into this? Should I?
- How can I “flatten” the plural values (like the “
( Cisco Systems, Inc. )”) into singular values?
- How can I format the values as needed? (The
format relevance command appears to require singular values, so the preceeding question may resolve this one)
I’m using plurals as a best practice (a la @jgstew) in order to avoid errors, but may be able to not do that as these registry keys are fairly (if not completely) consistent.
Anyone have an idea that’ll help me get what I need? Thanks!