Skip to content

Commit 40b3b11

Browse files
authored
Merge pull request #690 from sara-rn/bug-update-selected-packages
Fix Install-Selected-Packages to update the config
2 parents 79831e2 + e4dce7e commit 40b3b11

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

install.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,19 +723,24 @@ if (-not $noGui.IsPresent) {
723723
# Function that adds the selected packages to the config.xml for the installation
724724
function Install-Selected-Packages{
725725
$selectedPackages = @()
726+
$packages = $configXml.SelectSingleNode('//packages')
727+
728+
# Remove all child nodes inside <packages>
729+
while ($packages.HasChildNodes) {
730+
$packages.RemoveChild($packages.FirstChild)
731+
}
732+
726733
foreach ($checkBox in $checkboxesPackages){
727734
if ($checkBox.Checked){
728735
$package =$checkbox.Text.split(":")[0]
729-
Write-Host ("{0} has been selected" -f $package)
730736
$selectedPackages+=$package
731737
}
732738
}
733739
# Add selected packages
734-
$packages = $configXml.SelectSingleNode('//packages')
735740
foreach($package in $selectedPackages) {
736741
$newXmlNode = $packages.AppendChild($configXml.CreateElement("package"))
737742
$newXmlNode.SetAttribute("name", $package)
738-
}
743+
}
739744
}
740745

741746
# Function that resets the checkboxes to match the config.xml

0 commit comments

Comments
 (0)