From 25ecf5c6ac6f744191f0ebe0232ff94152f74f8b Mon Sep 17 00:00:00 2001 From: Graham Flynn <34700017+flynngw@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:30:10 +0800 Subject: [PATCH 1/4] Update Get-AbrSRMProtectionGroup.ps1 Fixed issue where if a protection group was not protecting any VMs, it would list the VMs in the previous protection group in the output. --- Src/Private/Get-AbrSRMProtectionGroup.ps1 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Src/Private/Get-AbrSRMProtectionGroup.ps1 b/Src/Private/Get-AbrSRMProtectionGroup.ps1 index 67bdfbc..e7d5253 100644 --- a/Src/Private/Get-AbrSRMProtectionGroup.ps1 +++ b/Src/Private/Get-AbrSRMProtectionGroup.ps1 @@ -5,7 +5,7 @@ function Get-AbrSRMProtectionGroup { .DESCRIPTION Documents the configuration of VMware SRM in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.4.2 + Version: 0.4.3 Author: Jonathan Colon & Tim Carman Twitter: @jcolonfzenpr / @tpcarman Github: @rebelinux / @tpcarman @@ -83,6 +83,9 @@ function Get-AbrSRMProtectionGroup { if ($ProtectionGroup.ListProtectedVMs()) { $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs().vm.MoRef } + else { + $ProtectedVMs = "" + } $inObj = [ordered] @{ 'Name' = $ProtectionGroupInfo.Name @@ -117,9 +120,15 @@ function Get-AbrSRMProtectionGroup { if ($ProtectionGroup.ListProtectedVMs()) { $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs().vm.MoRef } + else { + $ProtectedVMs = "" + } if ($ProtectionGroup.ListAssociatedVms()) { $AssociatedVMs = ConvertTo-VIobject $ProtectionGroup.ListAssociatedVms().MoRef } + else { + $AssociatedVMs = "" + } $inObj = [ordered] @{ 'Name' = $ProtectionGroupInfo.Name @@ -161,6 +170,9 @@ function Get-AbrSRMProtectionGroup { if ($ProtectionGroup.ListProtectedVMs()) { $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs().vm.MoRef } + else { + $ProtectedVMs = "" + } if ($ProtectionGroup.ListProtectedDatastores()) { $ProtectedDatastores = ConvertTo-VIobject $ProtectionGroup.ListProtectedDatastores().MoRef @@ -197,6 +209,9 @@ function Get-AbrSRMProtectionGroup { if ($ProtectionGroup.ListProtectedVMs()) { $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs().vm.MoRef } + else { + $ProtectedVMs = "" + } if ($ProtectionGroup.ListProtectedDatastores()) { $ProtectedDatastores = ConvertTo-VIobject $ProtectionGroup.ListProtectedDatastores().MoRef @@ -248,6 +263,9 @@ function Get-AbrSRMProtectionGroup { if ($ProtectionGroup.ListProtectedVMs()) { $ProtectedVMs = $ProtectionGroup.ListProtectedVMs() } + else { + $ProtectedVMs = "" + } if ($InfoLevel.ProtectionGroup -eq 2) { foreach ($ProtectedVM in $ProtectedVMs) { try { @@ -349,4 +367,4 @@ function Get-AbrSRMProtectionGroup { } } end {} -} \ No newline at end of file +} From 529d7420567c2d5b9843aced53551e3bce614cf5 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Tue, 7 Nov 2023 23:23:25 -0400 Subject: [PATCH 2/4] Update Src/Private/Get-AbrSRMProtectionGroup.ps1 --- Src/Private/Get-AbrSRMProtectionGroup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-AbrSRMProtectionGroup.ps1 b/Src/Private/Get-AbrSRMProtectionGroup.ps1 index e7d5253..8c1acdc 100644 --- a/Src/Private/Get-AbrSRMProtectionGroup.ps1 +++ b/Src/Private/Get-AbrSRMProtectionGroup.ps1 @@ -5,7 +5,7 @@ function Get-AbrSRMProtectionGroup { .DESCRIPTION Documents the configuration of VMware SRM in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.4.3 + Version: 0.4.5 Author: Jonathan Colon & Tim Carman Twitter: @jcolonfzenpr / @tpcarman Github: @rebelinux / @tpcarman From 2520541488fbc668d984249b03a59643ed26dc6a Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Thu, 9 Nov 2023 08:33:24 -0400 Subject: [PATCH 3/4] Update AsBuiltReport.VMware.SRM.psd1 --- AsBuiltReport.VMware.SRM.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsBuiltReport.VMware.SRM.psd1 b/AsBuiltReport.VMware.SRM.psd1 index 06438b5..42033a7 100644 --- a/AsBuiltReport.VMware.SRM.psd1 +++ b/AsBuiltReport.VMware.SRM.psd1 @@ -12,7 +12,7 @@ RootModule = 'AsBuiltReport.VMware.SRM.psm1' # Version number of this module. -ModuleVersion = '0.4.4' +ModuleVersion = '0.4.5' # Supported PSEditions # CompatiblePSEditions = @() From 15f05627a6321e36f27b7026b9c7cd5c9f837c76 Mon Sep 17 00:00:00 2001 From: Jonathan Colon Date: Thu, 9 Nov 2023 08:59:18 -0400 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 274d387..2518860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # :arrows_clockwise: VMware SRM As Built Report Changelog +## [0.4.5] - 2023-11-09 + +### Fixed + +- Fix issue where if a protection group was not protecting any VMs, it would list the VMs in the previous protection group in the output. @flynngw + ## [0.4.4] - 2023-08-25 ### Fixed