@@ -6,7 +6,7 @@ function Get-AbrVbrDiagrammer {
66 . DESCRIPTION
77 Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
88 . NOTES
9- Version: 0.8.17
9+ Version: 0.8.19
1010 Author: Jonathan Colon
1111 Twitter: @jcolonfzenpr
1212 Github: rebelinux
@@ -19,7 +19,7 @@ function Get-AbrVbrDiagrammer {
1919 param (
2020 [Parameter (Mandatory = $false , Position = 0 )]
2121 [ValidateNotNullOrEmpty ()]
22- [ValidateSet (' Backup-to-Tape' , ' Backup-to-File-Proxy' , ' Backup-to-HyperV-Proxy' , ' Backup-to-vSphere-Proxy' , ' Backup-to-Repository' , ' Backup-to-Sobr' , ' Backup-to-WanAccelerator' , ' Backup-to-ProtectedGroup' , ' Backup-Infrastructure' , ' All ' )]
22+ [ValidateSet (' Backup-to-Tape' , ' Backup-to-File-Proxy' , ' Backup-to-HyperV-Proxy' , ' Backup-to-vSphere-Proxy' , ' Backup-to-Repository' , ' Backup-to-Sobr' , ' Backup-to-WanAccelerator' , ' Backup-to-ProtectedGroup' , ' Backup-Infrastructure' )]
2323 [string ]$DiagramType = ' Backup-Infrastructure' ,
2424 [Parameter (Mandatory = $false , Position = 1 )]
2525 [ValidateNotNullOrEmpty ()]
@@ -29,7 +29,7 @@ function Get-AbrVbrDiagrammer {
2929 )
3030
3131 begin {
32- Write-PScriboMessage " Getting Veeam diagram for $System ."
32+ Write-PScriboMessage " Generating Veeam diagram ( $DiagramType ) from Backup Server $System ."
3333 }
3434
3535 process {
@@ -88,66 +88,34 @@ function Get-AbrVbrDiagrammer {
8888 $DiagramParams.Add (' AuthorName' , $Options.SignatureAuthorName )
8989 $DiagramParams.Add (' CompanyName' , $Options.SignatureCompanyName )
9090 }
91-
92- if ($DiagramType -eq ' All' ) {
93- try {
94- foreach ($DiagramTypeItem in $DiagramTypeHash.Keys ) {
95- foreach ($Format in $DiagramFormat ) {
96- if ($Format -eq " base64" ) {
97- $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramTypeItem - Format $Format
98- if ($Graph ) {
99- $Graph
100- }
101- } else {
102- $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramTypeItem - Format $Format - Filename " AsBuiltReport.Veeam.VBR-($ ( $DiagramTypeHash [$DiagramTypeItem ]) ).$ ( $Format ) "
103- if ($Graph ) {
104- if ($ExportPath ) {
105- $FilePath = Join-Path - Path $OutputFolderPath - ChildPath " AsBuiltReport.Veeam.VBR-($ ( $DiagramTypeHash [$DiagramTypeItem ]) ).$ ( $Format ) "
106- if (Test-Path - Path $FilePath ) {
107- $FilePath
108- } else {
109- Write-PScriboMessage - IsWarning " Unable to export the $DiagramTypeHash Diagram: $ ( $_.Exception.Message ) "
110- }
111- } else {
112- Write-Information " Saved 'AsBuiltReport.Veeam.VBR-($ ( $DiagramTypeHash [$DiagramTypeItem ]) ).$ ( $Format ) ' diagram to '$ ( $OutputFolderPath ) '." - InformationAction Continue
113- }
114- }
115- }
91+ try {
92+ foreach ($Format in $DiagramFormat ) {
93+ if ($Format -eq " base64" ) {
94+ $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramType - Format $Format
95+ if ($Graph ) {
96+ $Graph
11697 }
117- }
118- } catch {
119- Write-PScriboMessage - IsWarning " Unable to export the $DiagramTypeHash Diagram: $ ( $_.Exception.Message ) "
120- }
121- } else {
122- try {
123- foreach ($Format in $DiagramFormat ) {
124- if ($Format -eq " base64" ) {
125- $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramType - Format $Format
126- if ($Graph ) {
127- $Graph
128- }
129- } else {
130- $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramType - Format $Format - Filename " AsBuiltReport.Veeam.VBR-($ ( $DiagramTypeHash [$DiagramType ]) ).$ ( $Format ) "
131- if ($Graph ) {
132- if ($ExportPath ) {
133- $FilePath = Join-Path - Path $OutputFolderPath - ChildPath " AsBuiltReport.Veeam.VBR-($ ( $DiagramTypeHash [$DiagramType ]) ).$ ( $Format ) "
134- if (Test-Path - Path $FilePath ) {
135- $FilePath
136- } else {
137- Write-PScriboMessage - IsWarning " Unable to export the $DiagramTypeHash Diagram: $ ( $_.Exception.Message ) "
138- }
98+ } else {
99+ $Graph = New-VeeamDiagram @DiagramParams - DiagramType $DiagramType - Format $Format - Filename " AsBuiltReport.Veeam.VBR-$ ( $DiagramTypeHash [$DiagramType ]) .$ ( $Format ) "
100+ if ($Graph ) {
101+ if ($ExportPath ) {
102+ $FilePath = Join-Path - Path $OutputFolderPath - ChildPath " AsBuiltReport.Veeam.VBR-$ ( $DiagramTypeHash [$DiagramType ]) .$ ( $Format ) "
103+ if (Test-Path - Path $FilePath ) {
104+ $FilePath
139105 } else {
140- Write-Information " Saved 'AsBuiltReport.Veeam.VBR-( $ ( $DiagramTypeHash [ $ DiagramType] ) ). $ ( $Format ) ' diagram to ' $ ( $OutputFolderPath ) '. " - InformationAction Continue
106+ Write-PScriboMessage - IsWarning " Unable to export the $ DiagramType Diagram: $ ( $_ .Exception.Message ) "
141107 }
108+ } else {
109+ Write-Information " Saved 'AsBuiltReport.Veeam.VBR-$ ( $DiagramTypeHash [$DiagramType ]) .$ ( $Format ) ' diagram to '$ ( $OutputFolderPath ) '." - InformationAction Continue
142110 }
143111 }
144112 }
145- } catch {
146- Write-PScriboMessage - IsWarning " Unable to export the $DiagramTypeHash Diagram: $ ( $_.Exception.Message ) "
147113 }
114+ } catch {
115+ Write-PScriboMessage - IsWarning " Unable to export the $ ( $DiagramTypeHash [$DiagramType ]) Diagram: $ ( $_.Exception.Message ) "
148116 }
149117 } catch {
150- Write-PScriboMessage - IsWarning " Unable to get the $DiagramTypeHash Diagram: $ ( $_.Exception.Message ) "
118+ Write-PScriboMessage - IsWarning " Unable to get the $ ( $ DiagramTypeHash[ $DiagramType ] ) Diagram: $ ( $_.Exception.Message ) "
151119 }
152120 }
153121 end {}
0 commit comments