take $jsonObject.ManualDesktopSpec.VirtualCenter

ManualDesktopSpec.VirtualCenter of json file was not taken care of. This could cause new-hvpool fail when creating with json file and there are multiple vcenters added to broker.
This commit is contained in:
Ivy Huang
2022-03-17 16:11:21 +08:00
committed by GitHub
parent 829307318f
commit d5f851339b

View File

@@ -4561,6 +4561,9 @@ function New-HVPool {
} elseIf ($jsonObject.type -eq "MANUAL") { } elseIf ($jsonObject.type -eq "MANUAL") {
$MANUAL = $true $MANUAL = $true
$poolType = 'MANUAL' $poolType = 'MANUAL'
if ($null -ne $jsonObject.ManualDesktopSpec.VirtualCenter) {
$vCenter = $jsonObject.ManualDesktopSpec.VirtualCenter
}
$userAssignment = $jsonObject.ManualDesktopSpec.userAssignment.userAssignment $userAssignment = $jsonObject.ManualDesktopSpec.userAssignment.userAssignment
$automaticAssignment = $jsonObject.ManualDesktopSpec.userAssignment.AutomaticAssignment $automaticAssignment = $jsonObject.ManualDesktopSpec.userAssignment.AutomaticAssignment
$source = $jsonObject.ManualDesktopSpec.source $source = $jsonObject.ManualDesktopSpec.source