Hallo Alsion,
wie Blub schon schreibt, ist hier ein Hashtable das Mittel der Wahl. Ich habe dir mal eine "Quick & Dirty Lösung" niedergeschrieben.
Bei einem Hashtable wird einem Key ein Wert zugewiesen. Dieser Hashtable kann am besten mit einer foreach Schleife durchlaufen werden, diese ist speziell für Arrays und Hashtables gedacht.
$path="HKCU:\Software\test"
$hash=@{key1="value1"; key2="value2"; key3="value3"}
foreach ($key in $hash.Keys)
{
If (Get-ItemProperty -Path $path -Name $key)
{
$RegValue = Get-ItemProperty -Path $path -Name $key
$RegValue = $RegValue.$key
If ($RegValue)
{
$HashValue = $hash.get_Item($key)
Set-ItemProperty -Path $path -Name $key -Value "$RegValue;$HashValue"
}
Else
{
New-ItemProperty -Path $path -Name $key -Value "$HashValue"
}
}
}