Fix XML root element references;Deleted comments
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -63,7 +63,6 @@ ForEach ($Disk in $OVFConfig.DynamicDisks) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $XMLDisk = $XML.CreateElement('Disk', $XML.DocumentElement.xmlns)
 | 
					    $XMLDisk = $XML.CreateElement('Disk', $XML.DocumentElement.xmlns)
 | 
				
			||||||
    # $XMLDiskAttrUnits = $XML.CreateAttribute('capacityAllocationUnits', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
    Switch ($Disk.UnitSize) {
 | 
					    Switch ($Disk.UnitSize) {
 | 
				
			||||||
        'KB' {
 | 
					        'KB' {
 | 
				
			||||||
            $Powers = 10
 | 
					            $Powers = 10
 | 
				
			||||||
@@ -85,27 +84,11 @@ ForEach ($Disk in $OVFConfig.DynamicDisks) {
 | 
				
			|||||||
            Continue
 | 
					            Continue
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    # $XMLDiskAttrUnits.Value = "byte * 2^$($Powers)"
 | 
					    [void]$XMLDisk.SetAttribute('capacityAllocationUnits', $NS.LookupNamespace('ovf'), "byte * 2^$($Powers)")
 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('capacityAllocationUnits', $NS.LookupNamespace('ovf'), "byte * 2^$($Powers)")
 | 
					    [void]$XMLDisk.SetAttribute('format', $NS.LookupNamespace('ovf'), 'http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized')
 | 
				
			||||||
    # $XMLDiskAttrFormat = $XML.CreateAttribute('format', $XML.DocumentElement.ovf)
 | 
					    [void]$XMLDisk.SetAttribute('diskId', $NS.LookupNamespace('ovf'), "vmdisk$($DiskId)")
 | 
				
			||||||
    # $XMLDiskAttrFormat.Value = 'http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized'
 | 
					    [void]$XMLDisk.SetAttribute('capacity', $NS.LookupNamespace('ovf'), '${{vmconfig.disksize.{0}}}' -f $DiskId)
 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('format', $NS.LookupNamespace('ovf'), 'http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized')
 | 
					    [void]$XMLDisk.SetAttribute('populatedSize', $NS.LookupNamespace('ovf'), 0)
 | 
				
			||||||
    # $XMLDiskId = $XML.CreateAttribute('diskId', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
    # $XMLDiskId.Value = "vmdisk$($DiskId)"
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('diskId', $NS.LookupNamespace('ovf'), "vmdisk$($DiskId)")
 | 
					 | 
				
			||||||
    # $XMLDiskAttrCapacity = $XML.CreateAttribute('capacity', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
    # $XMLDiskAttrCapacity.Value = '${{vmconfig.disksize.{0}}}' -f $DiskId
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('capacity', $NS.LookupNamespace('ovf'), '${{vmconfig.disksize.{0}}}' -f $DiskId)
 | 
					 | 
				
			||||||
    # $XMLDiskAttrPopulated = $XML.CreateAttribute('populatedSize', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
    # $XMLDiskAttrPopulated.Value = 0
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('populatedSize', $NS.LookupNamespace('ovf'), 0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # [void]$XMLDisk.Attributes.Append($XMLDiskAttrUnits)
 | 
					 | 
				
			||||||
    # [void]$XMLDisk.Attributes.Append($XMLDiskAttrFormat)
 | 
					 | 
				
			||||||
    # [void]$XMLDisk.Attributes.Append($XMLDiskId)
 | 
					 | 
				
			||||||
    # [void]$XMLDisk.Attributes.Append($XMLDiskAttrCapacity)
 | 
					 | 
				
			||||||
    # [void]$XMLDisk.Attributes.Append($XMLDiskAttrPopulated)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    [void]$XML.SelectSingleNode('//ns:DiskSection', $NS).AppendChild($XMLDisk)
 | 
					    [void]$XML.SelectSingleNode('//ns:DiskSection', $NS).AppendChild($XMLDisk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Add new resourceType nodes
 | 
					    # Add new resourceType nodes
 | 
				
			||||||
@@ -120,7 +103,7 @@ ForEach ($Disk in $OVFConfig.DynamicDisks) {
 | 
				
			|||||||
        $InstanceID++
 | 
					        $InstanceID++
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    $XMLDiskItem.SelectSingleNode('rasd:InstanceID', $NS).InnerText = $InstanceID
 | 
					    $XMLDiskItem.SelectSingleNode('rasd:InstanceID', $NS).InnerText = $InstanceID
 | 
				
			||||||
    $XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLDiskItem)
 | 
					    [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLDiskItem)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $OVFConfig.PropertyCategories[0].ProductProperties += @{
 | 
					    $OVFConfig.PropertyCategories[0].ProductProperties += @{
 | 
				
			||||||
        Key              = "vmconfig.disksize.$($DiskId)"
 | 
					        Key              = "vmconfig.disksize.$($DiskId)"
 | 
				
			||||||
@@ -148,17 +131,13 @@ If ($OVFConfig.DeploymentConfigurations.Count -gt 0) {
 | 
				
			|||||||
    ForEach ($Configuration in $OVFConfig.DeploymentConfigurations) {
 | 
					    ForEach ($Configuration in $OVFConfig.DeploymentConfigurations) {
 | 
				
			||||||
        $XMLConfig = $XML.CreateElement('Configuration', $XML.DocumentElement.xmlns)
 | 
					        $XMLConfig = $XML.CreateElement('Configuration', $XML.DocumentElement.xmlns)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
        # $XMLConfigAttrId = $XML.CreateAttribute('id', $XML.DocumentElement.ovf)
 | 
					        [void]$XMLConfig.SetAttribute('id', $NS.LookupNamespace('ovf'), $Configuration.Id)
 | 
				
			||||||
        # $XMLConfigAttrId.Value = $Configuration.Id
 | 
					 | 
				
			||||||
        [void]$XMLExtraConfig.SetAttribute('id', $NS.LookupNamespace('ovf'), $Configuration.Id)
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
        $XMLConfigLabel = $XML.CreateElement('Label', $XML.DocumentElement.xmlns)
 | 
					        $XMLConfigLabel = $XML.CreateElement('Label', $XML.DocumentElement.xmlns)
 | 
				
			||||||
        $XMLConfigLabel.InnerText = $Configuration.Label
 | 
					        $XMLConfigLabel.InnerText = $Configuration.Label
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
        $XMLConfigDescription = $XML.CreateElement('Description', $XML.DocumentElement.xmlns)
 | 
					        $XMLConfigDescription = $XML.CreateElement('Description', $XML.DocumentElement.xmlns)
 | 
				
			||||||
        $XMLConfigDescription.InnerText = $Configuration.Description
 | 
					        $XMLConfigDescription.InnerText = $Configuration.Description
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
        # [void]$XMLConfig.Attributes.Append($XMLConfigAttrId)
 | 
					 | 
				
			||||||
        [void]$XMLConfig.AppendChild($XMLConfigLabel)
 | 
					        [void]$XMLConfig.AppendChild($XMLConfigLabel)
 | 
				
			||||||
        [void]$XMLConfig.AppendChild($XMLConfigDescription)
 | 
					        [void]$XMLConfig.AppendChild($XMLConfigDescription)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@@ -173,7 +152,7 @@ If ($OVFConfig.DeploymentConfigurations.Count -gt 0) {
 | 
				
			|||||||
        $XMLMemoryTemplate = $XML.SelectSingleNode("//ns:VirtualHardwareSection/ns:Item/rasd:ResourceType[.='4']", $NS).ParentNode.CloneNode($True)
 | 
					        $XMLMemoryTemplate = $XML.SelectSingleNode("//ns:VirtualHardwareSection/ns:Item/rasd:ResourceType[.='4']", $NS).ParentNode.CloneNode($True)
 | 
				
			||||||
        # Delete default resourceType nodes
 | 
					        # Delete default resourceType nodes
 | 
				
			||||||
        ForEach ($Node in $XML.SelectNodes("//ns:VirtualHardwareSection/ns:Item/rasd:ResourceType[.='3' or .='4']", $NS).ParentNode) {
 | 
					        ForEach ($Node in $XML.SelectNodes("//ns:VirtualHardwareSection/ns:Item/rasd:ResourceType[.='3' or .='4']", $NS).ParentNode) {
 | 
				
			||||||
            $Node.ParentNode.RemoveChild($Node)
 | 
					            [void]$Node.ParentNode.RemoveChild($Node)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        # Add updated resourceType nodes
 | 
					        # Add updated resourceType nodes
 | 
				
			||||||
        ForEach ($Configuration in $OVFConfig.DeploymentConfigurations) {
 | 
					        ForEach ($Configuration in $OVFConfig.DeploymentConfigurations) {
 | 
				
			||||||
@@ -187,32 +166,20 @@ If ($OVFConfig.DeploymentConfigurations.Count -gt 0) {
 | 
				
			|||||||
            $XMLMemory.SelectSingleNode('rasd:ElementName', $NS).InnerText = '{0}MB of memory' -f $Configuration.Size.Memory
 | 
					            $XMLMemory.SelectSingleNode('rasd:ElementName', $NS).InnerText = '{0}MB of memory' -f $Configuration.Size.Memory
 | 
				
			||||||
            $XMLMemory.SelectSingleNode('rasd:VirtualQuantity', $NS).InnerText = $Configuration.Size.Memory
 | 
					            $XMLMemory.SelectSingleNode('rasd:VirtualQuantity', $NS).InnerText = $Configuration.Size.Memory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLCPU)
 | 
					            [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLCPU)
 | 
				
			||||||
            $XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLMemory)
 | 
					            [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLMemory)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# $XMLAttrTransport = $XML.CreateAttribute('transport', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
# $XMLAttrTransport.Value = 'com.vmware.guestInfo'
 | 
					 | 
				
			||||||
# [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).Attributes.Append($XMLAttrTransport)
 | 
					 | 
				
			||||||
[void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).SetAttribute('transport', $NS.LookupNamespace('ovf'), 'com.vmware.guestInfo')
 | 
					[void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).SetAttribute('transport', $NS.LookupNamespace('ovf'), 'com.vmware.guestInfo')
 | 
				
			||||||
ForEach ($ExtraConfig in $OVFConfig.AdvancedOptions) {
 | 
					ForEach ($ExtraConfig in $OVFConfig.AdvancedOptions) {
 | 
				
			||||||
    $XMLExtraConfig = $XML.CreateElement('vmw:ExtraConfig', $XML.DocumentElement.vmw)
 | 
					    $XMLExtraConfig = $XML.CreateElement('vmw:ExtraConfig', $XML.DocumentElement.vmw)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # $XMLExtraConfigAttrRequired = $XML.CreateAttribute('required', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
    # $XMLExtraConfigAttrRequired.Value = "$([boolean]$ExtraConfig.Required)".ToLower()
 | 
					 | 
				
			||||||
    # $XMLExtraConfigAttrKey = $XML.CreateAttribute('key', $XML.DocumentElement.vmw)
 | 
					 | 
				
			||||||
    # $XMLExtraConfigAttrKey.Value = $ExtraConfig.Key
 | 
					 | 
				
			||||||
    # $XMLExtraConfigAttrValue = $XML.CreateAttribute('value', $XML.DocumentElement.vmw)
 | 
					 | 
				
			||||||
    # $XMLExtraConfigAttrValue.Value = $ExtraConfig.Value
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # [void]$XMLExtraConfig.Attributes.Append($XMLExtraConfigAttrRequired)
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('required', $NS.LookupNamespace('ovf'), "$([boolean]$ExtraConfig.Required)".ToLower())
 | 
					    [void]$XMLExtraConfig.SetAttribute('required', $NS.LookupNamespace('ovf'), "$([boolean]$ExtraConfig.Required)".ToLower())
 | 
				
			||||||
    # [void]$XMLExtraConfig.Attributes.Append($XMLExtraConfigAttrKey)
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('key', $NS.LookupNamespace('vmw'), $ExtraConfig.Key)
 | 
					    [void]$XMLExtraConfig.SetAttribute('key', $NS.LookupNamespace('vmw'), $ExtraConfig.Key)
 | 
				
			||||||
    # [void]$XMLExtraConfig.Attributes.Append($XMLExtraConfigAttrValue)
 | 
					 | 
				
			||||||
    [void]$XMLExtraConfig.SetAttribute('value', $NS.LookupNamespace('vmw'), $ExtraConfig.Value)
 | 
					    [void]$XMLExtraConfig.SetAttribute('value', $NS.LookupNamespace('vmw'), $ExtraConfig.Value)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLExtraConfig)
 | 
					    [void]$XML.SelectSingleNode('//ns:VirtualHardwareSection', $NS).AppendChild($XMLExtraConfig)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
Write-Host "Added $($OVFConfig.AdvancedOptions.Count) 'vmw:ExtraConfig' nodes"
 | 
					Write-Host "Added $($OVFConfig.AdvancedOptions.Count) 'vmw:ExtraConfig' nodes"
 | 
				
			||||||
@@ -244,18 +211,13 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
 | 
				
			|||||||
    ForEach ($Property in $Category.ProductProperties) {
 | 
					    ForEach ($Property in $Category.ProductProperties) {
 | 
				
			||||||
        $XMLProperty = $XML.CreateElement('Property', $XML.DocumentElement.xmlns)
 | 
					        $XMLProperty = $XML.CreateElement('Property', $XML.DocumentElement.xmlns)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
        # $XMLPropertyAttrKey = $XML.CreateAttribute('key', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
        # $XMLPropertyAttrKey.Value = $Property.Key
 | 
					 | 
				
			||||||
        $XMLProperty.SetAttribute('key', $NS.LookupNamespace('ovf'), $Property.Key)
 | 
					        $XMLProperty.SetAttribute('key', $NS.LookupNamespace('ovf'), $Property.Key)
 | 
				
			||||||
        # $XMLPropertyAttrType = $XML.CreateAttribute('type', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
        Switch -regex ($Property.Type) {
 | 
					        Switch -regex ($Property.Type) {
 | 
				
			||||||
            '^boolean' {
 | 
					            '^boolean' {
 | 
				
			||||||
                # $XMLPropertyAttrType.Value = 'boolean'
 | 
					                [void]$XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'boolean')
 | 
				
			||||||
                $XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'boolean')
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            '^int' {
 | 
					            '^int' {
 | 
				
			||||||
                # $XMLPropertyAttrType.Value = 'uint16'
 | 
					                [void]$XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'uint16')
 | 
				
			||||||
                $XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'uint16')
 | 
					 | 
				
			||||||
                $Qualifiers = @()
 | 
					                $Qualifiers = @()
 | 
				
			||||||
                If ($Property.Type -match '^int\((\d*)\.\.(\d*)\)') {
 | 
					                If ($Property.Type -match '^int\((\d*)\.\.(\d*)\)') {
 | 
				
			||||||
                    If ($Matches[1]) {
 | 
					                    If ($Matches[1]) {
 | 
				
			||||||
@@ -264,28 +226,16 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
 | 
				
			|||||||
                    If ($Matches[2]) {
 | 
					                    If ($Matches[2]) {
 | 
				
			||||||
                        $Qualifiers += "MaxValue($($Matches[2]))"
 | 
					                        $Qualifiers += "MaxValue($($Matches[2]))"
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers = $XML.CreateAttribute('qualifiers', $XML.DocumentElement.ovf)
 | 
					                    [void]$XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers.Value = $Qualifiers -join ' '
 | 
					 | 
				
			||||||
                    # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrQualifiers)
 | 
					 | 
				
			||||||
                    $XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            '^ip' {
 | 
					            '^ip' {
 | 
				
			||||||
                # $XMLPropertyAttrType.Value = 'string'
 | 
					                [void]$XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
				
			||||||
                $XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
					                [void]$XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('vmw'), 'Ip')
 | 
				
			||||||
                # $XMLPropertyAttrQualifiers = $XML.CreateAttribute('qualifiers', $XML.DocumentElement.vmw)
 | 
					 | 
				
			||||||
                # $XMLPropertyAttrQualifiers.Value = 'Ip'
 | 
					 | 
				
			||||||
                # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrQualifiers)
 | 
					 | 
				
			||||||
                $XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('vmw'), 'Ip')
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            '^password' {
 | 
					            '^password' {
 | 
				
			||||||
                # $XMLPropertyAttrType.Value = 'string'
 | 
					                [void]$XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
				
			||||||
                $XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
					                [void]$XMLProperty.SetAttribute('password', $NS.LookupNamespace('ovf'), 'true')
 | 
				
			||||||
                # $XMLPropertyAttrPassword = $XML.CreateAttribute('password', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
                # $XMLPropertyAttrPassword.Value = 'true'
 | 
					 | 
				
			||||||
                # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrPassword)
 | 
					 | 
				
			||||||
                $XMLProperty.SetAttribute('password', $NS.LookupNamespace('ovf'), 'true')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                $Qualifiers = @()
 | 
					                $Qualifiers = @()
 | 
				
			||||||
                If ($Property.Type -match '^password\((\d*)\.\.(\d*)\)') {
 | 
					                If ($Property.Type -match '^password\((\d*)\.\.(\d*)\)') {
 | 
				
			||||||
                    If ($Matches[1]) {
 | 
					                    If ($Matches[1]) {
 | 
				
			||||||
@@ -294,15 +244,11 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
 | 
				
			|||||||
                    If ($Matches[2]) {
 | 
					                    If ($Matches[2]) {
 | 
				
			||||||
                        $Qualifiers += "MaxLen($($Matches[2]))"
 | 
					                        $Qualifiers += "MaxLen($($Matches[2]))"
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers = $XML.CreateAttribute('qualifiers', $XML.DocumentElement.ovf)
 | 
					                    [void]$XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers.Value = $Qualifiers -join ' '
 | 
					 | 
				
			||||||
                    # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrQualifiers)
 | 
					 | 
				
			||||||
                    $XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            '^string' {
 | 
					            '^string' {
 | 
				
			||||||
                # $XMLPropertyAttrType.Value = 'string'
 | 
					                [void]$XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
				
			||||||
                $XMLProperty.SetAttribute('type', $NS.LookupNamespace('ovf'), 'string')
 | 
					 | 
				
			||||||
                $Qualifiers = @()
 | 
					                $Qualifiers = @()
 | 
				
			||||||
                If ($Property.Type -match '^string\((\d*)\.\.(\d*)\)') {
 | 
					                If ($Property.Type -match '^string\((\d*)\.\.(\d*)\)') {
 | 
				
			||||||
                    If ($Matches[1]) {
 | 
					                    If ($Matches[1]) {
 | 
				
			||||||
@@ -311,33 +257,19 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
 | 
				
			|||||||
                    If ($Matches[2]) {
 | 
					                    If ($Matches[2]) {
 | 
				
			||||||
                        $Qualifiers += "MaxLen($($Matches[2]))"
 | 
					                        $Qualifiers += "MaxLen($($Matches[2]))"
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers = $XML.CreateAttribute('qualifiers', $XML.DocumentElement.ovf)
 | 
					                    [void]$XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers.Value = $Qualifiers -join ' '
 | 
					 | 
				
			||||||
                    # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrQualifiers)
 | 
					 | 
				
			||||||
                    $XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), $Qualifiers -join ' ')
 | 
					 | 
				
			||||||
                } ElseIf ($Property.Type -match '^string\[(.*)\]') {
 | 
					                } ElseIf ($Property.Type -match '^string\[(.*)\]') {
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers = $XML.CreateAttribute('qualifiers', $XML.DocumentElement.ovf)
 | 
					                    [void]$XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), "ValueMap{$($Matches[1] -replace '","', '", "')}")
 | 
				
			||||||
                    # $XMLPropertyAttrQualifiers.Value = "ValueMap{$($Matches[1] -replace '","', '", "')}"
 | 
					 | 
				
			||||||
                    # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrQualifiers)
 | 
					 | 
				
			||||||
                    $XMLProperty.SetAttribute('qualifiers', $NS.LookupNamespace('ovf'), "ValueMap{$($Matches[1] -replace '","', '", "')}")
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        # $XMLPropertyAttrUserConfigurable = $XML.CreateAttribute('userConfigurable', $XML.DocumentElement.ovf)
 | 
					        [void]$XMLProperty.SetAttribute('userConfigurable', $NS.LookupNamespace('ovf'), "$([boolean]$Property.UserConfigurable)".ToLower())
 | 
				
			||||||
        # $XMLPropertyAttrUserConfigurable.Value = "$([boolean]$Property.UserConfigurable)".ToLower()
 | 
					
 | 
				
			||||||
        $XMLProperty.SetAttribute('userConfigurable', $NS.LookupNamespace('ovf'), "$([boolean]$Property.UserConfigurable)".ToLower())
 | 
					 | 
				
			||||||
        # $XMLPropertyAttrValue = $XML.CreateAttribute('value', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
        If ($Property.Type -eq 'boolean') {
 | 
					        If ($Property.Type -eq 'boolean') {
 | 
				
			||||||
            # $XMLPropertyAttrValue.Value = "$([boolean]$Property.DefaultValue)".ToLower()
 | 
					            [void]$XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), "$([boolean]$Property.DefaultValue)".ToLower())
 | 
				
			||||||
            $XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), "$([boolean]$Property.DefaultValue)".ToLower())
 | 
					 | 
				
			||||||
        } Else {
 | 
					        } Else {
 | 
				
			||||||
            # $XMLPropertyAttrValue.Value = $Property.DefaultValue
 | 
					            [void]$XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), $Property.DefaultValue)
 | 
				
			||||||
            $XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), $Property.DefaultValue)
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrKey)
 | 
					 | 
				
			||||||
        # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrType)
 | 
					 | 
				
			||||||
        # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrUserConfigurable)
 | 
					 | 
				
			||||||
        # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrValue)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        If ($Property.Label) {
 | 
					        If ($Property.Label) {
 | 
				
			||||||
            $XMLPropertyLabel = $XML.CreateElement('Label', $XML.DocumentElement.xmlns)
 | 
					            $XMLPropertyLabel = $XML.CreateElement('Label', $XML.DocumentElement.xmlns)
 | 
				
			||||||
@@ -351,35 +283,19 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        If (($Property.Configurations.Count -eq 1) -and ($Property.Configurations -eq '*')) {
 | 
					        If (($Property.Configurations.Count -eq 1) -and ($Property.Configurations -eq '*')) {
 | 
				
			||||||
            # $XMLPropertyAttrConfiguration = $XML.CreateAttribute('configuration', $XML.DocumentElement.ovf)
 | 
					            [void]$XMLProperty.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $OVFConfig.DeploymentConfigurations.Id -join ' ')
 | 
				
			||||||
            # $XMLPropertyAttrConfiguration.Value = $OVFConfig.DeploymentConfigurations.Id -join ' '
 | 
					 | 
				
			||||||
            # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrConfiguration)       
 | 
					 | 
				
			||||||
            $XMLProperty.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $OVFConfig.DeploymentConfigurations.Id -join ' ')
 | 
					 | 
				
			||||||
        } ElseIf ($Property.Configurations.Count -gt 0) {
 | 
					        } ElseIf ($Property.Configurations.Count -gt 0) {
 | 
				
			||||||
            # $XMLPropertyAttrConfiguration = $XML.CreateAttribute('configuration', $XML.DocumentElement.ovf)
 | 
					            [void]$XMLProperty.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $Property.Configurations -join ' ')
 | 
				
			||||||
            # $XMLPropertyAttrConfiguration.Value = $Property.Configurations -join ' '
 | 
					 | 
				
			||||||
            # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrConfiguration)       
 | 
					 | 
				
			||||||
            $XMLProperty.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $Property.Configurations -join ' ')
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        If ($Property.Value.Count -eq 1) {
 | 
					        If ($Property.Value.Count -eq 1) {
 | 
				
			||||||
            # $XMLPropertyAttrValue = $XML.CreateAttribute('value', $XML.DocumentElement.ovf)
 | 
					            [void]$XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), $Property.Value)
 | 
				
			||||||
            # $XMLPropertyAttrValue.Value = $Property.Value
 | 
					 | 
				
			||||||
            # [void]$XMLProperty.Attributes.Append($XMLPropertyAttrValue)       
 | 
					 | 
				
			||||||
            $XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), $Property.Value)
 | 
					 | 
				
			||||||
        } ElseIf ($Property.Value.Count -gt 1) {
 | 
					        } ElseIf ($Property.Value.Count -gt 1) {
 | 
				
			||||||
            ForEach ($Value in $Property.Value) {
 | 
					            ForEach ($Value in $Property.Value) {
 | 
				
			||||||
                $XMLValue = $XML.CreateElement('Value', $XML.DocumentElement.xmlns)
 | 
					                $XMLValue = $XML.CreateElement('Value', $XML.DocumentElement.xmlns)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # $XMLValueAttrValue = $XML.CreateAttribute('value', $XML.DocumentElement.ovf)
 | 
					                [void]$XMLValue.SetAttribute('value', $NS.LookupNamespace('ovf'), $Value)
 | 
				
			||||||
                # $XMLValueAttrValue.Value = $Value
 | 
					                [void]$XMLValue.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $Value)
 | 
				
			||||||
                $XMLProperty.SetAttribute('value', $NS.LookupNamespace('ovf'), $Value)
 | 
					 | 
				
			||||||
                # $XMLValueAttrConfiguration = $XML.CreateAttribute('configuration', $XML.DocumentElement.ovf)
 | 
					 | 
				
			||||||
                # $XMLValueAttrConfiguration.Value = $Value
 | 
					 | 
				
			||||||
                $XMLProperty.SetAttribute('configuration', $NS.LookupNamespace('ovf'), $Value)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                # [void]$XMLValue.Attributes.Append($XMLValueAttrValue)
 | 
					 | 
				
			||||||
                # [void]$XMLValue.Attributes.Append($XMLValueAttrConfiguration)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                [void]$XMLProperty.AppendChild($XMLValue)
 | 
					                [void]$XMLProperty.AppendChild($XMLValue)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user