I am currently trying to access the registry, obtain all the sub keys with it's appropriate values and then substitute these values with an XML config.
For example:
Within the XML document the following value is stored:
<Name = "Test" Value = "\\somelocation\TOKEN\Application" />
<Name = "Test1" Value = "\\somelocation\TOKEN\Deployment" />
The registry key holds the token value:
TOKEN= LifeCycleManagement
Therefore I want powershell to subsitute "\somelocation\TOKEN*" with "\somelocation\LifeCycleManagement*"
Any ideas please?
Currently I am trying the following code:
$lineElement = @()
$regItems = Get-ItemProperty registrylocation
Get-ItemProperty registrylocation > c:\DEV\output.txt
$contents = Get-Content c:\DEV\output.txt
foreach ($line in $contents)
{
$line = $line -split(":")
$lineElement += $line[0]
}
foreach ($element in $lineElement)
{
$element
$regItems.$element
}
The $regItems.$element is not returning any results.