From a7ded04317b2c2f2666fee42a358963b3a9ccf8f Mon Sep 17 00:00:00 2001 From: djpbessems Date: Mon, 10 May 2021 16:27:49 +0200 Subject: [PATCH] Fix missing XML namespace --- scripts/Update-OvfConfiguration.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++