Fix missing XML namespace
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2021-05-10 16:27:49 +02:00
parent 454b5e92b0
commit a7ded04317

View File

@ -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++