Update method to add VMs to Object
This commit is contained in:
@@ -214,7 +214,6 @@ function New-ZertoVpg {
|
|||||||
$unprotectedVms = Get-ZertoUnprotectedVm
|
$unprotectedVms = Get-ZertoUnprotectedVm
|
||||||
$protectedVms = Get-ZertoProtectedVm
|
$protectedVms = Get-ZertoProtectedVm
|
||||||
# Create array of VM identifiers
|
# Create array of VM identifiers
|
||||||
$vmIdentifiers = @()
|
|
||||||
$vmIdentifiers = foreach ($vm in $protectedVm) {
|
$vmIdentifiers = foreach ($vm in $protectedVm) {
|
||||||
# If the VM is unprotected, get the identifier
|
# If the VM is unprotected, get the identifier
|
||||||
$vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $vm } | Select-Object -ExpandProperty vmIdentifier
|
$vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $vm } | Select-Object -ExpandProperty vmIdentifier
|
||||||
@@ -314,13 +313,7 @@ function New-ZertoVpg {
|
|||||||
$baseSettings.Recovery.DefaultDatastoreIdentifier = $identifiersTable['datastoreIdentifier']
|
$baseSettings.Recovery.DefaultDatastoreIdentifier = $identifiersTable['datastoreIdentifier']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# If only 1 VM is selected, force VMs settings to be an array.
|
$basesettings.Vms += $vmIdentifiers
|
||||||
If ($vmIdentifiers.count -eq 1) {
|
|
||||||
$basesettings.Vms = @()
|
|
||||||
$baseSettings.Vms += $vmIdentifiers
|
|
||||||
} else {
|
|
||||||
$baseSettings.Vms = $vmIdentifiers
|
|
||||||
}
|
|
||||||
if ($identifiersTable.ContainsKey('journalDatastore')) {
|
if ($identifiersTable.ContainsKey('journalDatastore')) {
|
||||||
$baseSettings.Journal.DatastoreIdentifier = $identifiersTable['journalDatastore']
|
$baseSettings.Journal.DatastoreIdentifier = $identifiersTable['journalDatastore']
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user