Skip to content

Commit

Permalink
Merge pull request #27 from AsBuiltReport/dev
Browse files Browse the repository at this point in the history
v0.4.5 public release
  • Loading branch information
rebelinux authored Nov 9, 2023
2 parents 9ae707d + 15f0562 commit 3a3b5ed
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AsBuiltReport.VMware.SRM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @()
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 20 additions & 2 deletions Src/Private/Get-AbrSRMProtectionGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.5
Author: Jonathan Colon & Tim Carman
Twitter: @jcolonfzenpr / @tpcarman
Github: @rebelinux / @tpcarman
Expand Down Expand Up @@ -83,6 +83,9 @@ function Get-AbrSRMProtectionGroup {
if ($ProtectionGroup.ListProtectedVMs()) {
$ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs().vm.MoRef
}
else {
$ProtectedVMs = ""
}

$inObj = [ordered] @{
'Name' = $ProtectionGroupInfo.Name
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -349,4 +367,4 @@ function Get-AbrSRMProtectionGroup {
}
}
end {}
}
}

0 comments on commit 3a3b5ed

Please sign in to comment.