From c0081efa4c048e15548a03ac4d795e07638cf3a0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 8 Jul 2023 23:54:56 +0200 Subject: [PATCH] Modify proper partitions --- profiles/DerGeret/Windows/Setup.ps1 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/profiles/DerGeret/Windows/Setup.ps1 b/profiles/DerGeret/Windows/Setup.ps1 index 9ac5a5e6..e347c1ce 100644 --- a/profiles/DerGeret/Windows/Setup.ps1 +++ b/profiles/DerGeret/Windows/Setup.ps1 @@ -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 -ge $newIndex) { - $partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText = "$($partitionID + 1)"; - $partition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$($partitionID + 1)"; + if ($partitionID -eq 2) { + $newID--; + } else { + if ($partitionID -ge $newIndex) { + $newID++; + } + + if ($partitionID -lt 2) { + $newID++; + } + } + + if ($partitionID -ne $newID) { + $partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText = "$newID"; + $partition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newID"; } }