Improve user experience;Upgrade dependency
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-12-26 17:01:05 +01:00
parent 6de8ea3029
commit fcb05e2e12
3 changed files with 10 additions and 9 deletions

View File

@ -245,7 +245,7 @@ dependencies:
- filename: yq
url: http://github.com/mikefarah/yq/releases/download/v4.30.5/yq_linux_amd64
- filename: vappprop-manager
url: https://code.spamasaurus.com/api/packages/djpbessems/generic/vappprop-manager/v0.3.1/vappprop-manager
url: https://code.spamasaurus.com/api/packages/djpbessems/generic/vappprop-manager/v0.3.2/vappprop-manager
packages:
apt:

View File

@ -102,7 +102,7 @@ ForEach ($Disk in $OVFConfig.DynamicDisks) {
$XML.SelectSingleNode("//ns:VirtualHardwareSection/ns:Item/rasd:InstanceID[.='$($HighestInstanceID)']", $NS).ParentNode
)
$OVFConfig.PropertyCategories[0].ProductProperties += @{
$OVFConfig.PropertyCategories[@([int]$Disk.PropertyCategory, 0)[![boolean]$Disk.PropertyCategory]].ProductProperties += @{
Key = "vmconfig.disksize.$($DiskId)"
Type = If ([boolean]$Disk.Constraints.Minimum -or [boolean]$Disk.Constraints.Maximum) {
"Int($($Disk.Constraints.Minimum)..$($Disk.Constraints.Maximum))"
@ -124,20 +124,20 @@ If ($OVFConfig.DeploymentConfigurations.Count -gt 0) {
$XMLSectionInfo = $XML.CreateElement('Info', $XML.DocumentElement.xmlns)
$XMLSectionInfo.InnerText = 'Deployment Type'
[void]$XMLSection.AppendChild($XMLSectionInfo)
ForEach ($Configuration in $OVFConfig.DeploymentConfigurations) {
$XMLConfig = $XML.CreateElement('Configuration', $XML.DocumentElement.xmlns)
[void]$XMLConfig.SetAttribute('id', $NS.LookupNamespace('ovf'), $Configuration.Id)
$XMLConfigLabel = $XML.CreateElement('Label', $XML.DocumentElement.xmlns)
$XMLConfigLabel.InnerText = $Configuration.Label
$XMLConfigDescription = $XML.CreateElement('Description', $XML.DocumentElement.xmlns)
$XMLConfigDescription.InnerText = $Configuration.Description
[void]$XMLConfig.AppendChild($XMLConfigLabel)
[void]$XMLConfig.AppendChild($XMLConfigDescription)
[void]$XMLSection.AppendChild($XMLConfig)
}
[void]$XML.SelectSingleNode('//ns:Envelope', $NS).InsertAfter($XMLSection, $XML.SelectSingleNode('//ns:NetworkSection', $NS))
@ -213,7 +213,7 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
ForEach ($Property in $Category.ProductProperties) {
$XMLProperty = $XML.CreateElement('Property', $XML.DocumentElement.xmlns)
[void]$XMLProperty.SetAttribute('key', $NS.LookupNamespace('ovf'), $Property.Key)
Switch -regex ($Property.Type) {
'^boolean' {
@ -309,4 +309,4 @@ ForEach ($Category in $OVFConfig.PropertyCategories) {
Write-Host "Inserted $($Category.ProductProperties.Count) new node(s) into 'ProductSection'"
}
$XML.Save($SourceFile.FullName)
$XML.Save($SourceFile.FullName)

View File

@ -15,6 +15,7 @@ DynamicDisks:
Constraints:
Minimum: 100
Maximum: ''
PropertyCategory: 1
PropertyCategories: