Modify proper partitions

This commit is contained in:
Manuel Thalmann 2023-07-08 23:54:56 +02:00
parent 1c41cdd1c0
commit 36a663b897

View file

@ -59,10 +59,23 @@ $Global:SetupConfigPostprocessor = {
for ($i = 0; $i -lt $partitionModifications.ChildNodes.Count; $i++) {
$partition = $partitionModifications.ChildNodes[$i];
$partitionID = [int]$partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText;
$newID = $partitionID;
if ($partitionID -eq 2) {
$newID--;
} else {
if ($partitionID -ge $newIndex) {
$partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText = "$($partitionID + 1)";
$partition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$($partitionID + 1)";
$newID++;
}
if ($partitionID -lt 2) {
$newID++;
}
}
if ($partitionID -ne $newID) {
$partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText = "$newID";
$partition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newID";
}
}