hi friends
in PS 4.0 I am creating a script which in one of the steps, turns off IE ESC in my servers in test lab.so I have to write a code like the following:
$mypath="Registry::\HKEY_LOCAL_MACHINE\software\Microsoft\active setup\installed components\{A509B1A8-4b3f-8CFC-4F3A74704073}"
set-ItemProperty-path$mypath-nameisinstalled-value0-Force-Verbose
but as you see the registry path is somehow long. I want to know is it possible to use Regex here to shorten the path?
for example suppose in my path, after HKLM there is only one key which starts with "SO", then only one ode starts with "Mi" and so on. so how can i use regex here to create $mypath something like this:
$mypath = "registry::\HKEY_LOCAL_MACHINE\so*\Mi*\ac*\in*\Com*\{A50*
here asterisks * i mean for example because i know, there is only one value at the end of this registry path which starts with {A50 so for simplicity & avoiding typos, i only write some initial characters. in other words i want to tell system that:
at the root of this path: HKEY_LOCAL_MACHINE\ find any key which starts with "so" & the rest characters can be anything ( no matter because there is only one registry which starts with "so" (software key)
really thanks for any response