Skip to content

Commit

Permalink
fix: address pnp named cell changes (#699)
Browse files Browse the repository at this point in the history
Updates to `Export-PdrJsonSpec` cmdlet to support old and new named cells in the PnP
- replicationSubnet
- replicationGateway

- Fixed `Export-PdrJsonSpec` cmdlet where brackets were missing around the -as [Int]

Signed-off-by: Gary Blake <gblake@vmware.com>
  • Loading branch information
GaryJBlake authored Jul 18, 2024
1 parent 56adef2 commit 03ba5bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion PowerValidatedSolutions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'PowerValidatedSolutions.psm1'

# Version number of this module.
ModuleVersion = '2.11.0.1054'
ModuleVersion = '2.11.0.1055'

# ID used to uniquely identify this module
GUID = 'a6dfed7b-65d2-4da2-bdcc-7f3d3df9b75d'
Expand Down
14 changes: 7 additions & 7 deletions PowerValidatedSolutions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2575,9 +2575,9 @@ Function Export-PdrJsonSpec {
'vrmsAdminEmail' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_admin_email"].Value
'replicationPortgroup' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_pg"].Value
'replicationVlan' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_vlan"].Value -as [Int]
'replicationSubnet' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value
'replicationSubnet' = if ($null -eq $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value) { $pnpProtectedWorkbook.Workbook.Names["mgmt_az1_vrms_cidr"].Value } else { $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value }
'replicationIpAddress' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_vrms_ip"].Value
'replicationGateway' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value
'replicationGateway' = if ($null -eq $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value) { $pnpProtectedWorkbook.Workbook.Names["mgmt_az1_vrms_gateway_ip"].Value } else { $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value }
'replicationNetmask' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_mask"].Value
'remoteReplicationNetwork' = $pnpProtectedWorkbook.Workbook.Names["mgmt_vrms_recovery_replication_cidr"].Value
'replicationIpAddresses' = @("$($pnpProtectedWorkbook.Workbook.Names["mgmt_az1_host1_vrms_ip"].Value)", "$($pnpProtectedWorkbook.Workbook.Names["mgmt_az1_host2_vrms_ip"].Value)", "$($pnpProtectedWorkbook.Workbook.Names["mgmt_az1_host3_vrms_ip"].Value)", "$($pnpProtectedWorkbook.Workbook.Names["mgmt_az1_host4_vrms_ip"].Value)")
Expand Down Expand Up @@ -2635,9 +2635,9 @@ Function Export-PdrJsonSpec {
'vrmsAdminEmail' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_admin_email"].Value
'replicationPortgroup' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_pg"].Value
'replicationVlan' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_vlan"].Value -as [Int]
'replicationSubnet' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value
'replicationSubnet' = if ($null -eq $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value) { $pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_vrms_cidr"].Value } else { $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_cidr"].Value }
'replicationIpAddress' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_vrms_ip"].Value
'replicationGateway' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value
'replicationGateway' = if ($null -eq $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value) { $pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_vrms_gateway_ip"].Value } else { $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_gateway_ip"].Value }
'replicationNetmask' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_mask"].Value
'remoteReplicationNetwork' = $pnpRecoveryWorkbook.Workbook.Names["mgmt_vrms_recovery_replication_cidr"].Value
'replicationIpAddresses' = @("$($pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_host1_vrms_ip"].Value)", "$($pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_host2_vrms_ip"].Value)", "$($pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_host3_vrms_ip"].Value)", "$($pnpRecoveryWorkbook.Workbook.Names["mgmt_az1_host4_vrms_ip"].Value)")
Expand Down Expand Up @@ -2731,9 +2731,9 @@ Function Export-PdrJsonSpec {
$jsonObject | Add-Member -notepropertyname 'antiAffinityRuleOperations' -notepropertyvalue "anti-affinity-rule-operations"
$jsonObject | Add-Member -notepropertyname 'drsGroupNameOperations' -notepropertyvalue $pnpProtectedWorkbook.Workbook.Names["xreg_vrops_vm_group_name"].Value
$jsonObject | Add-Member -notepropertyname 'vmToVmRuleNameOperations' -notepropertyvalue $pnpProtectedWorkbook.Workbook.Names["xreg_vrops_vm_to_vm_rule_name"].Value
$jsonObject | Add-Member -notepropertyname 'notificationInterval' -notepropertyvalue $pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_interval"].Value -as [Int]
$jsonObject | Add-Member -notepropertyname 'notificationMax' -notepropertyvalue $pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_max"].Value -as [Int]
$jsonObject | Add-Member -notepropertyname 'notificationDelay' -notepropertyvalue $pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_delay"].Value -as [Int]
$jsonObject | Add-Member -notepropertyname 'notificationInterval' -notepropertyvalue ($pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_interval"].Value -as [Int])
$jsonObject | Add-Member -notepropertyname 'notificationMax' -notepropertyvalue ($pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_max"].Value -as [Int])
$jsonObject | Add-Member -notepropertyname 'notificationDelay' -notepropertyvalue ($pnpProtectedWorkbook.Workbook.Names["xreg_vrops_notification_delay"].Value -as [Int])
}

if ($pnpProtectedWorkbook.Workbook.Names["private_cloud_result"].Value -eq "Included") {
Expand Down

0 comments on commit 03ba5bb

Please sign in to comment.