Fix script for altering windows partitions
This commit is contained in:
parent
40ceab479a
commit
3d68fcde47
1 changed files with 5 additions and 5 deletions
|
@ -13,14 +13,14 @@ $Global:SetupConfigPostprocessor = {
|
||||||
|
|
||||||
$newIndex = 2;
|
$newIndex = 2;
|
||||||
$installationPartition.InnerText = "$($newIndex + 1)";
|
$installationPartition.InnerText = "$($newIndex + 1)";
|
||||||
$partitionCreations = $diskConfig.SelectSingleNode("./ua:CreatePartitions", $namespace);
|
$partitionCreationContainer = $diskConfig.SelectSingleNode("./ua:CreatePartitions", $namespace);
|
||||||
$winPartition = ($partitionCreations.SelectNodes("./ua:CreatePartition", $namespace) | Select-Object -Last 1);
|
$partitionCreations = $partitionCreationContainer.SelectNodes("./ua:CreatePartition", $namespace);
|
||||||
|
$winPartition = ($partitionCreations | Select-Object -Last 1);
|
||||||
$newPartition = $winPartition.CloneNode($true);
|
$newPartition = $winPartition.CloneNode($true);
|
||||||
|
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
|
|
||||||
for ($i = 0; $i -lt $partitionCreations.ChildNodes.Count; $i++) {
|
foreach ($partition in $partitionCreations) {
|
||||||
$partition = $partitionCreations.ChildNodes[$i];
|
|
||||||
$order = [int]$partition.SelectSingleNode("./ua:Order", $namespace).InnerText;
|
$order = [int]$partition.SelectSingleNode("./ua:Order", $namespace).InnerText;
|
||||||
$offset += [int]$partition.SelectSingleNode("./ua:Size", $namespace).InnerText;
|
$offset += [int]$partition.SelectSingleNode("./ua:Size", $namespace).InnerText;
|
||||||
$newOrder = $order;
|
$newOrder = $order;
|
||||||
|
@ -49,7 +49,7 @@ $Global:SetupConfigPostprocessor = {
|
||||||
$winPartition.AppendChild($size);
|
$winPartition.AppendChild($size);
|
||||||
|
|
||||||
$newPartition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex";
|
$newPartition.SelectSingleNode("./ua:Order", $namespace).InnerText = "$newIndex";
|
||||||
$null = $partitionCreations.AppendChild($newPartition);
|
$null = $partitionCreationContainer.AppendChild($newPartition);
|
||||||
|
|
||||||
$partitionModifications = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace);
|
$partitionModifications = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace);
|
||||||
$newModification = $partitionModifications.SelectNodes("./ua:ModifyPartition", $namespace)[2].CloneNode($true);
|
$newModification = $partitionModifications.SelectNodes("./ua:ModifyPartition", $namespace)[2].CloneNode($true);
|
||||||
|
|
Loading…
Reference in a new issue