I'm trying to use set-itemproperty to add an item to: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Installation Sources
$InstallationSources = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" -Name "Installation Sources"
$test = $InstallationSources."Installation Sources" + "C:\Test\I386"
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" -Name "Installation Sources" "$test"
I can echo $test and it looks fine, several lines of paths with my addition at the end. But when I actually use set-itempproperty, it squishes everything into one line, which doesn't work. Each path needs to have its own line. Even manually added newlines aren't passed in (ie: "`nC:\Test\I386"). Ideas?
Thanks