diff --git a/scripts/Update-OvfConfiguration.ps1 b/scripts/Update-OvfConfiguration.ps1 index f1eddd0..5d8e705 100644 --- a/scripts/Update-OvfConfiguration.ps1 +++ b/scripts/Update-OvfConfiguration.ps1 @@ -51,7 +51,7 @@ $NS = [System.Xml.XmlNamespaceManager]$XML.NameTable [void]$NS.AddNamespace('ovf', $XML.DocumentElement.ovf) ForEach ($ReferencedDisk in $OVFConfig.Disks.Referenced) { - $XMLDisk = $XML.SelectSingleNode("//ns:DiskSection/ns:Disk[@ovf:diskId='$($ReferencedDisk.Id)']") + $XMLDisk = $XML.SelectSingleNode("//ns:DiskSection/ns:Disk[@ovf:diskId='$($ReferencedDisk.Id)']", $NS) If ($XMLDisk.Count -eq 1) { Switch ($ReferencedDisk.UnitSize) { 'KB' { @@ -83,7 +83,7 @@ ForEach ($ReferencedDisk in $OVFConfig.Disks.Referenced) { } ForEach ($DynamicDisk in $OVFConfig.Disks.Dynamic) { # Determine next free available diskId - $XMLDisks = $XML.SelectNodes("//ns:DiskSection/ns:Disk[contains(@ovf:diskId,'vmdisk')]") + $XMLDisks = $XML.SelectNodes("//ns:DiskSection/ns:Disk[contains(@ovf:diskId,'vmdisk')]", $NS) $DiskId = $XMLDisks.Count + 1 While ($XMLDisks.DiskId -contains "vmdisk$($DiskId)") { $DiskId++