Install windows to the last partition
This commit is contained in:
parent
12500b1993
commit
afa570e498
1 changed files with 7 additions and 3 deletions
|
@ -5,11 +5,15 @@ $env:SETUP_SCRIPT_NAME = [System.IO.Path]::GetRelativePath("$PSScriptRoot/../../
|
|||
$Global:SetupConfigPostprocessor = {
|
||||
param([xml] $config, [System.Xml.XmlNamespaceManager] $namespace)
|
||||
|
||||
$diskConfig = $config.SelectSingleNode(
|
||||
"/ua:unattend/ua:settings[@pass='windowsPE']/ua:component[@name='Microsoft-Windows-Setup']/ua:DiskConfiguration/ua:Disk",
|
||||
$setupComponent = $config.SelectSingleNode(
|
||||
"/ua:unattend/ua:settings[@pass='windowsPE']/ua:component[@name='Microsoft-Windows-Setup']",
|
||||
$namespace);
|
||||
|
||||
$newIndex = 4;
|
||||
$diskConfig = $setupComponent.SelectSingleNode("./ua:DiskConfiguration/ua:Disk", $namespace);
|
||||
$installationPartition = $setupComponent.SelectSingleNode("./ua:ImageInstall/ua:OSImage/ua:InstallTo/ua:PartitionID");
|
||||
|
||||
$newIndex = [int]$installationPartition.InnerText;
|
||||
$installationPartition.InnerText = "$($newIndex + 1)";
|
||||
$partitionCreations = $diskConfig.SelectSingleNode("./ua:CreatePartitions");
|
||||
$newPartition = $partitionCreations.FirstChild.CloneNode($true);
|
||||
$newPartition.SelectSingleNode("./ua:Order").InnerText = "$newIndex";
|
||||
|
|
Loading…
Reference in a new issue