Initialize variables before use
This commit is contained in:
parent
1f71a46ebb
commit
c29a08919e
1 changed files with 12 additions and 12 deletions
|
@ -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)";
|
||||
|
||||
|
|
Loading…
Reference in a new issue