Skip to content

Commit

Permalink
Merge pull request #137 from rebelinux/dev
Browse files Browse the repository at this point in the history
Fixes before v0.8.4 release
  • Loading branch information
rebelinux authored Jan 16, 2024
2 parents 907498f + 704e753 commit 2b3a213
Show file tree
Hide file tree
Showing 22 changed files with 390 additions and 866 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :arrows_clockwise: Veeam VBR As Built Report Changelog

## [0.8.4] - 2024-01-0?
## [0.8.4] - 2024-01-16

### Added

Expand All @@ -17,8 +17,11 @@

### Fixed

- Fix [#134](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/134)
- Fix [#131](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/131)
- Fix [#132](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/132)
- Fix [#133](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/133)
- Fix [#134](https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR/issues/134)


## [0.8.3] - 2023-12-29

Expand Down
43 changes: 43 additions & 0 deletions Src/Private/Get-AbrVbrAgentBackupjobConf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,49 @@ function Get-AbrVbrAgentBackupjobConf {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
if ($ABkjob.ScheduleOptions.BackupTerminationWindowEnabled) {
try {
Section -Style NOTOCHeading6 -ExcludeFromTOC "Backup Window Time Period" {
Paragraph {
Text 'Permited \' -Color 81BC50 -Bold
Text ' Denied' -Color dddf62 -Bold
}

$OutObj = Get-WindowsTimePeriod -InputTimePeriod $ABkjob.ScheduleOptions.TerminationWindow

$TableParams = @{
Name = "Backup Window - $($ABkjob.Name)"
List = $true
ColumnWidths = 6,4,3,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4
Key = 'H'
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
if ($OutObj) {
$OutObj2 = Table -Hashtable $OutObj @TableParams
$OutObj2.Rows | Where-Object {$_.Sun -eq "0"} | Set-Style -Style OFF -Property "Sun"
$OutObj2.Rows | Where-Object {$_.Mon -eq "0"} | Set-Style -Style OFF -Property "Mon"
$OutObj2.Rows | Where-Object {$_.Tue -eq "0"} | Set-Style -Style OFF -Property "Tue"
$OutObj2.Rows | Where-Object {$_.Wed -eq "0"} | Set-Style -Style OFF -Property "Wed"
$OutObj2.Rows | Where-Object {$_.Thu -eq "0"} | Set-Style -Style OFF -Property "Thu"
$OutObj2.Rows | Where-Object {$_.Fri -eq "0"} | Set-Style -Style OFF -Property "Fri"
$OutObj2.Rows | Where-Object {$_.Sat -eq "0"} | Set-Style -Style OFF -Property "Sat"

$OutObj2.Rows | Where-Object {$_.Sun -eq "1"} | Set-Style -Style ON -Property "Sun"
$OutObj2.Rows | Where-Object {$_.Mon -eq "1"} | Set-Style -Style ON -Property "Mon"
$OutObj2.Rows | Where-Object {$_.Tue -eq "1"} | Set-Style -Style ON -Property "Tue"
$OutObj2.Rows | Where-Object {$_.Wed -eq "1"} | Set-Style -Style ON -Property "Wed"
$OutObj2.Rows | Where-Object {$_.Thu -eq "1"} | Set-Style -Style ON -Property "Thu"
$OutObj2.Rows | Where-Object {$_.Fri -eq "1"} | Set-Style -Style ON -Property "Fri"
$OutObj2.Rows | Where-Object {$_.Sat -eq "1"} | Set-Style -Style ON -Property "Sat"
$OutObj2
}
}
} catch {
Write-PscriboMessage -IsWarning $_.Exception.Message
}
}
}
catch {
Write-PscriboMessage -IsWarning "Agent Backup Jobs Advanced Settings (Schedule Options) Section: $($_.Exception.Message)"
Expand Down
47 changes: 2 additions & 45 deletions Src/Private/Get-AbrVbrBackupCopyjobConf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-AbrVbrBackupCopyjobConf {
.DESCRIPTION
Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
.NOTES
Version: 0.8.0
Version: 0.8.4
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down Expand Up @@ -507,51 +507,8 @@ function Get-AbrVbrBackupCopyjobConf {
Text 'Permited \' -Color 81BC50 -Bold
Text ' Denied' -Color dddf62 -Bold
}
$OutObj = @()
$Days = 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
$Hours24 = [ordered]@{
0 = 12
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
10 = 10
11 = 11
12 = 12
13 = 1
14 = 2
15 = 3
16 = 4
17 = 5
18 = 6
19 = 7
20 = 8
21 = 9
22 = 10
23 = 11
}

$ScheduleTimePeriod = $Bkjob.ScheduleOptions.TerminationWindow -split '(.{48})' | Where-Object {$_}

foreach ($OBJ in $Hours24.GetEnumerator()) {

$inObj = [ordered] @{
'H' = $OBJ.Value
'Sun' = $ScheduleTimePeriod[0].Split(',')[$OBJ.Key]
'Mon' = $ScheduleTimePeriod[1].Split(',')[$OBJ.Key]
'Tue' = $ScheduleTimePeriod[2].Split(',')[$OBJ.Key]
'Wed' = $ScheduleTimePeriod[3].Split(',')[$OBJ.Key]
'Thu' = $ScheduleTimePeriod[4].Split(',')[$OBJ.Key]
'Fri' = $ScheduleTimePeriod[5].Split(',')[$OBJ.Key]
'Sat' = $ScheduleTimePeriod[6].Split(',')[$OBJ.Key]
}
$OutObj += $inobj
}
$OutObj = Get-WindowsTimePeriod -InputTimePeriod $Bkjob.ScheduleOptions.TerminationWindow

$TableParams = @{
Name = "Backup Window - $($Bkjob.Name)"
Expand Down
4 changes: 2 additions & 2 deletions Src/Private/Get-AbrVbrBackupProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,11 @@ function Get-AbrVbrBackupProxy {
Write-PscriboMessage -IsWarning "VMware Backup Proxy Diagram: $($_.Exception.Message)"
}
if ($Graph) {
PageBreak
Section -Style Heading3 "VMware Backup Proxy Diagram." {
Image -Base64 $Graph -Text "VMware Backup Proxy Diagram" -Percent 20 -Align Center
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
}
BlankLine
}
}
}
Expand Down Expand Up @@ -885,11 +885,11 @@ function Get-AbrVbrBackupProxy {
Write-PscriboMessage -IsWarning "HyperV Backup Proxy Diagram: $($_.Exception.Message)"
}
if ($Graph) {
PageBreak
Section -Style Heading3 "HyperV Backup Proxy Diagram." {
Image -Base64 $Graph -Text "HyperV Backup Proxy Diagram" -Percent 20 -Align Center
Paragraph "Image preview: Opens the image in a new tab to view it at full resolution." -Tabs 2
}
BlankLine
}
}
}
Expand Down
45 changes: 5 additions & 40 deletions Src/Private/Get-AbrVbrBackupRepository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,53 +80,18 @@ function Get-AbrVbrBackupRepository {
try {
$sampleData = $OutObj | Select-Object -Property 'Name','Used Space %'

$exampleChart = New-Chart -Name BackupRepository -Width 600 -Height 400

$addChartAreaParams = @{
Chart = $exampleChart
Name = 'exampleChartArea'
}
$exampleChartArea = Add-ChartArea @addChartAreaParams -PassThru

$addChartSeriesParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'exampleChartSeries'
XField = 'Name'
YField = 'Used Space %'
Palette = 'Green'
ColorPerDataPoint = $true
}
$exampleChartSeries = $sampleData | Add-PieChartSeries @addChartSeriesParams -PassThru

$addChartLegendParams = @{
Chart = $exampleChart
Name = 'Backup Repository'
TitleAlignment = 'Center'
}
Add-ChartLegend @addChartLegendParams

$addChartTitleParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'UsedSpace'
Text = 'Percentage of Used Space'
Font = New-Object -TypeName 'System.Drawing.Font' -ArgumentList @('Arial', '12', [System.Drawing.FontStyle]::Bold)
}
Add-ChartTitle @addChartTitleParams

$chartFileItem = Export-Chart -Chart $exampleChart -Path (Get-Location).Path -Format "PNG" -PassThru
}
catch {
Write-PscriboMessage -IsWarning "Backup Repository graph Section: $($_.Exception.Message)"
$chartFileItem = Get-PieChart -SampleData $sampleData -ChartName 'BackupRepository' -XField 'Name' -YField 'Used Space %' -ChartLegendName 'Backup Repository' -ChartTitleName 'UsedSpace' -ChartTitleText 'Percentage of Used Space'
} catch {
Write-PscriboMessage -IsWarning "Backup Repository chart section: $($_.Exception.Message)"
}
}

if ($OutObj) {
Section -Style Heading3 'Backup Repository' {
Paragraph "The following section provides Backup Repository summary information."
BlankLine
if ($Options.EnableCharts -and $chartFileItem) {
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Path $chartFileItem
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Base64 $chartFileItem
}
BlankLine
$OutObj | Sort-Object -Property 'Name' | Table @TableParams
Expand Down
44 changes: 4 additions & 40 deletions Src/Private/Get-AbrVbrBackupjob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,51 +79,15 @@ function Get-AbrVbrBackupjob {
$Alljobs += (Get-VBRSureBackupJob -ErrorAction SilentlyContinue).LastResult
}
$sampleData = $Alljobs | Group-Object
$exampleChart = New-Chart -Name BackupJobs -Width 600 -Height 400

$addChartAreaParams = @{
Chart = $exampleChart
Name = 'BackupJobs'
AxisXTitle = 'Status'
AxisYTitle = 'Count'
NoAxisXMajorGridLines = $true
NoAxisYMajorGridLines = $true
}
$exampleChartArea = Add-ChartArea @addChartAreaParams -PassThru

$addChartSeriesParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'exampleChartSeries'
XField = 'Name'
YField = 'Count'
Palette = 'Green'
ColorPerDataPoint = $true
}
$sampleData | Add-ColumnChartSeries @addChartSeriesParams

$addChartTitleParams = @{
Chart = $exampleChart
ChartArea = $exampleChartArea
Name = 'BackupJob'
Text = 'Jobs Latest Result'
Font = New-Object -TypeName 'System.Drawing.Font' -ArgumentList @('Arial', '12', [System.Drawing.FontStyle]::Bold)
}
Add-ChartTitle @addChartTitleParams

$chartFileItem = Export-Chart -Chart $exampleChart -Path (Get-Location).Path -Format "PNG" -PassThru
$chartFileItem = Get-ColumnChart -SampleData $sampleData -ChartName 'BackupJobs' -XField 'Name' -YField 'Count' -ChartAreaName 'Infrastructure' -AxisXTitle 'Status' -AxisYTitle 'Count' -ChartTitleName 'BackupJobs' -ChartTitleText 'Jobs Latest Result'

if ($PassThru)
{
Write-Output -InputObject $chartFileItem
}
}
catch {
Write-PscriboMessage -IsWarning "$($_.Exception.Message) (Account Security Assessment Table)"
} catch {
Write-PscriboMessage -IsWarning "Backup Jobs chart section: $($_.Exception.Message)"
}
if ($OutObj) {
if ($chartFileItem) {
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Path $chartFileItem
Image -Text 'Backup Repository - Diagram' -Align 'Center' -Percent 100 -Base64 $chartFileItem
}
Section -Style Heading3 'Backup Jobs' {
Paragraph "The following section list backup jobs created in Veeam Backup & Replication."
Expand Down
Loading

0 comments on commit 2b3a213

Please sign in to comment.