diff --git a/profiles/DerGeret/Windows/Setup.ps1 b/profiles/DerGeret/Windows/Setup.ps1 index a2603873..a081fe19 100644 --- a/profiles/DerGeret/Windows/Setup.ps1 +++ b/profiles/DerGeret/Windows/Setup.ps1 @@ -9,6 +9,18 @@ function Initialize-SetupConfig() { ); $null = New-Module { + $setupComponent = $config.SelectSingleNode( + "/ua:unattend/ua:settings[@pass='windowsPE']/ua:component[@name='Microsoft-Windows-Setup']", + $namespace); + + $diskConfig = $setupComponent.SelectSingleNode("./ua:DiskConfiguration/ua:Disk", $namespace); + + $partitionCreationContainer = $diskConfig.SelectSingleNode("./ua:CreatePartitions", $namespace); + $partitionCreations = $partitionCreationContainer.SelectNodes("./ua:CreatePartition", $namespace); + + $partitionModificationContainer = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace); + $partitionModifications = $partitionModificationContainer.SelectNodes("./ua:ModifyPartition", $namespace); + <# .SYNOPSIS Gets the XML element describing the installation partition ID. @@ -112,18 +124,6 @@ function Initialize-SetupConfig() { } } - $setupComponent = $config.SelectSingleNode( - "/ua:unattend/ua:settings[@pass='windowsPE']/ua:component[@name='Microsoft-Windows-Setup']", - $namespace); - - $diskConfig = $setupComponent.SelectSingleNode("./ua:DiskConfiguration/ua:Disk", $namespace); - - $partitionCreationContainer = $diskConfig.SelectSingleNode("./ua:CreatePartitions", $namespace); - $partitionCreations = $partitionCreationContainer.SelectNodes("./ua:CreatePartition", $namespace); - - $partitionModificationContainer = $diskConfig.SelectSingleNode("./ua:ModifyPartitions", $namespace); - $partitionModifications = $partitionModificationContainer.SelectNodes("./ua:ModifyPartition", $namespace); - # Resize EFI partition to 1GB $partitionCreations[1].SelectSingleNode("./ua:Size", $namespace).InnerText = "$(1024)";