@@ -5,7 +5,7 @@ function Get-AbrSRMProtectionGroup {
55 . DESCRIPTION
66 Documents the configuration of VMware SRM in Word/HTML/Text formats using PScribo.
77 . NOTES
8- Version: 0.4.2
8+ Version: 0.4.5
99 Author: Jonathan Colon & Tim Carman
1010 Twitter: @jcolonfzenpr / @tpcarman
1111 Github: @rebelinux / @tpcarman
@@ -83,6 +83,9 @@ function Get-AbrSRMProtectionGroup {
8383 if ($ProtectionGroup.ListProtectedVMs ()) {
8484 $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs ().vm.MoRef
8585 }
86+ else {
87+ $ProtectedVMs = " "
88+ }
8689
8790 $inObj = [ordered ] @ {
8891 ' Name' = $ProtectionGroupInfo.Name
@@ -117,9 +120,15 @@ function Get-AbrSRMProtectionGroup {
117120 if ($ProtectionGroup.ListProtectedVMs ()) {
118121 $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs ().vm.MoRef
119122 }
123+ else {
124+ $ProtectedVMs = " "
125+ }
120126 if ($ProtectionGroup.ListAssociatedVms ()) {
121127 $AssociatedVMs = ConvertTo-VIobject $ProtectionGroup.ListAssociatedVms ().MoRef
122128 }
129+ else {
130+ $AssociatedVMs = " "
131+ }
123132
124133 $inObj = [ordered ] @ {
125134 ' Name' = $ProtectionGroupInfo.Name
@@ -161,6 +170,9 @@ function Get-AbrSRMProtectionGroup {
161170 if ($ProtectionGroup.ListProtectedVMs ()) {
162171 $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs ().vm.MoRef
163172 }
173+ else {
174+ $ProtectedVMs = " "
175+ }
164176
165177 if ($ProtectionGroup.ListProtectedDatastores ()) {
166178 $ProtectedDatastores = ConvertTo-VIobject $ProtectionGroup.ListProtectedDatastores ().MoRef
@@ -197,6 +209,9 @@ function Get-AbrSRMProtectionGroup {
197209 if ($ProtectionGroup.ListProtectedVMs ()) {
198210 $ProtectedVMs = ConvertTo-VIobject $ProtectionGroup.ListProtectedVMs ().vm.MoRef
199211 }
212+ else {
213+ $ProtectedVMs = " "
214+ }
200215
201216 if ($ProtectionGroup.ListProtectedDatastores ()) {
202217 $ProtectedDatastores = ConvertTo-VIobject $ProtectionGroup.ListProtectedDatastores ().MoRef
@@ -248,6 +263,9 @@ function Get-AbrSRMProtectionGroup {
248263 if ($ProtectionGroup.ListProtectedVMs ()) {
249264 $ProtectedVMs = $ProtectionGroup.ListProtectedVMs ()
250265 }
266+ else {
267+ $ProtectedVMs = " "
268+ }
251269 if ($InfoLevel.ProtectionGroup -eq 2 ) {
252270 foreach ($ProtectedVM in $ProtectedVMs ) {
253271 try {
@@ -349,4 +367,4 @@ function Get-AbrSRMProtectionGroup {
349367 }
350368 }
351369 end {}
352- }
370+ }
0 commit comments