Refactor processing of partition modifications
This commit is contained in:
parent
abcaf0ef99
commit
150892e21b
1 changed files with 5 additions and 5 deletions
|
@ -51,13 +51,13 @@ $Global:SetupConfigPostprocessor = {
|
|||
$newPartition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex";
|
||||
$null = $partitionCreationContainer.AppendChild($newPartition);
|
||||
|
||||
$partitionModifications = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace);
|
||||
$newModification = $partitionModifications.SelectNodes("./ua:ModifyPartition", $namespace)[2].CloneNode($true);
|
||||
$partitionModificationContainer = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace);
|
||||
$partitionModifications = $partitionModificationContainer.SelectNodes("./ModifyPartition", $namespace);
|
||||
$newModification = $partitionModifications[1].CloneNode($true);
|
||||
$newModification.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex";
|
||||
$newModification.SelectSingleNode("./ua:PartitionID", $namespace).InnerText = "$newIndex";
|
||||
|
||||
for ($i = 0; $i -lt $partitionModifications.ChildNodes.Count; $i++) {
|
||||
$partition = $partitionModifications.ChildNodes[$i];
|
||||
foreach ($partition in $partitionModifications) {
|
||||
$partitionID = [int]$partition.SelectSingleNode("./ua:PartitionID", $namespace).InnerText;
|
||||
$newID = $partitionID;
|
||||
|
||||
|
@ -79,7 +79,7 @@ $Global:SetupConfigPostprocessor = {
|
|||
}
|
||||
}
|
||||
|
||||
$null = $partitionModifications.AppendChild($newModification);
|
||||
$null = $partitionModificationContainer.AppendChild($newModification);
|
||||
}
|
||||
|
||||
. "$PSScriptRoot/../../../scripts/Windows/OS/Setup.ps1";
|
||||
|
|
Loading…
Reference in a new issue