Merge pull request #56 from ZertoPublic/CopyVpgBugFix
Fix Bug when Adding Additional VMs
This commit is contained in:
@@ -49,7 +49,9 @@ function Copy-ZertoVpg {
|
|||||||
if ($PSCmdlet.ShouldProcess("$VMsToAdd", "Copying $SourceVpgName to $NewVpgName with Settings")) {
|
if ($PSCmdlet.ShouldProcess("$VMsToAdd", "Copying $SourceVpgName to $NewVpgName with Settings")) {
|
||||||
$NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -Body ($VpgIdToCopy | ConvertTo-Json) -Method "POST"
|
$NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -Body ($VpgIdToCopy | ConvertTo-Json) -Method "POST"
|
||||||
$Uri = "{0}/{1}/vms" -f "vpgSettings", $NewVpgId
|
$Uri = "{0}/{1}/vms" -f "vpgSettings", $NewVpgId
|
||||||
$null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "POST"
|
foreach ($VM in $VMsToAdd) {
|
||||||
|
$null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VM | ConvertTo-Json) -Method "POST"
|
||||||
|
}
|
||||||
$Uri = "vpgSettings/{0}" -f $NewVpgId
|
$Uri = "vpgSettings/{0}" -f $NewVpgId
|
||||||
$CurrentSettings = Invoke-ZertoRestRequest -Uri $Uri
|
$CurrentSettings = Invoke-ZertoRestRequest -Uri $Uri
|
||||||
$CurrentSettings.Basic.Name = $NewVpgName
|
$CurrentSettings.Basic.Name = $NewVpgName
|
||||||
|
|||||||
Reference in New Issue
Block a user