diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 34bc137..10c4cf2 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -37,7 +37,7 @@ jobs: needs: publish-to-gallery runs-on: ubuntu-latest steps: - - uses: Eomm/why-don-t-you-tweet@v1 + - uses: Eomm/why-don-t-you-tweet@v2 # We don't want to tweet if the repository is not a public one if: ${{ !github.event.repository.private }} with: diff --git a/AsBuiltreport.Veeam.VBR.json b/AsBuiltreport.Veeam.VBR.json index ad0337e..e192f30 100644 --- a/AsBuiltreport.Veeam.VBR.json +++ b/AsBuiltreport.Veeam.VBR.json @@ -72,7 +72,7 @@ "FileShare": 1, "Surebackup": 1, "Replication": 1, - "Restores": 1, + "Restores": 0, "Tape": 1 } }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 496558f..40a399e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.8.7] - Unreleased +## [0.8.7] - 2024-05-27 ### Changed - Fix sorting of table [A-Z]. +- Disable the Backup Restore section (Some users reported issues with this section) +- Update the ReadMe file to reflect conflicts with PSWriteWord module +- Update the Eomm/why-don-t-you-tweet action to v2.0.0 +- General code cleanup/improvements ## [0.8.6] - 2024-04-29 diff --git a/README.md b/README.md index 9c36761..b1a7899 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ The table below outlines the default and maximum **InfoLevel** settings for each | Agent | 1 | 2 | | FileShare | 1 | 2 | | Replication | 1 | 2 | -| Restores | 1 | 1 | +| Restores | 0 | 1 | The table below outlines the default and maximum **InfoLevel** settings for each Replication section. @@ -274,4 +274,5 @@ PS C:\> New-AsBuiltReport -Report Veeam.VBR -Target veeam-vbr.pharmax.local -Use ## :x: Known Issues - Since many of Veeam's features depend on the Standard+ license, the Community edition is not supported. -- If the Veeam Backup Server is not joined to an Active Directory domain (WorkGroup Auth), the PSDefaultAuthentication option must be set to Negotiate. If it is not, some of the report sections will be missing. \ No newline at end of file +- If the Veeam Backup Server is not joined to an Active Directory domain (WorkGroup Auth), the PSDefaultAuthentication option must be set to Negotiate. If it is not, some of the report sections will be missing. +- This project uses the PScribo module to generate the report. It has been identified that the EvotecIT module `PSWriteWord` uses the same cmdlet names. In order for this report to be generated correctly it is necessary to uninstall the `PSWriteWord` module. \ No newline at end of file diff --git a/Src/Private/Get-AbrVbrAgentBackupjob.ps1 b/Src/Private/Get-AbrVbrAgentBackupjob.ps1 index 3848a7d..0d2f052 100644 --- a/Src/Private/Get-AbrVbrAgentBackupjob.ps1 +++ b/Src/Private/Get-AbrVbrAgentBackupjob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrAgentBackupjob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrAgentBackupjob { process { try { - $ABkjobs = Get-VBRComputerBackupJob - if (($ABkjobs).count -gt 0) { + if ($ABkjobs = Get-VBRComputerBackupJob) { Section -Style Heading3 'Agent Backup Jobs' { Paragraph "The following section list agent backup jobs created in Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrAgentBackupjobConf.ps1 b/Src/Private/Get-AbrVbrAgentBackupjobConf.ps1 index e4d1be1..cff3095 100644 --- a/Src/Private/Get-AbrVbrAgentBackupjobConf.ps1 +++ b/Src/Private/Get-AbrVbrAgentBackupjobConf.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrAgentBackupjobConf { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.6 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrAgentBackupjobConf { process { try { - $ABkjobs = Get-VBRComputerBackupJob | Sort-Object -Property Name - if (($ABkjobs).count -gt 0) { + if ($ABkjobs = Get-VBRComputerBackupJob | Sort-Object -Property Name) { Section -Style Heading3 'Agent Backup Jobs Configuration' { Paragraph "The following section details agent backup jobs configuration created in Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrBackupCopyjob .ps1 b/Src/Private/Get-AbrVbrBackupCopyjob .ps1 index ec283d7..d824510 100644 --- a/Src/Private/Get-AbrVbrBackupCopyjob .ps1 +++ b/Src/Private/Get-AbrVbrBackupCopyjob .ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrBackupCopyjob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.0 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrBackupCopyjob { process { try { - $BkCopyjobs = Get-VBRBackupCopyJob -WarningAction SilentlyContinue - if ($BkCopyjobs) { + if ($BkCopyjobs = Get-VBRBackupCopyJob -WarningAction SilentlyContinue) { Section -Style Heading3 'Backup Copy Jobs' { Paragraph "The following section list backup copy jobs created within Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrBackupCopyjobConf.ps1 b/Src/Private/Get-AbrVbrBackupCopyjobConf.ps1 index 8b0f28f..49e0aad 100644 --- a/Src/Private/Get-AbrVbrBackupCopyjobConf.ps1 +++ b/Src/Private/Get-AbrVbrBackupCopyjobConf.ps1 @@ -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.6 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrBackupCopyjobConf { process { try { - $Bkjobs = Get-VBRBackupCopyJob -WarningAction SilentlyContinue | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRBackupCopyJob -WarningAction SilentlyContinue | Sort-Object -Property Name) { Section -Style Heading3 'Backup Copy Jobs Configuration' { Paragraph "The following section details the configuration of backup copy jobs." BlankLine diff --git a/Src/Private/Get-AbrVbrBackupJobsRP.ps1 b/Src/Private/Get-AbrVbrBackupJobsRP.ps1 index 59c7048..c9a566d 100644 --- a/Src/Private/Get-AbrVbrBackupJobsRP.ps1 +++ b/Src/Private/Get-AbrVbrBackupJobsRP.ps1 @@ -5,7 +5,7 @@ function Get-AbrVbrBackupJobsRP { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -24,15 +24,13 @@ function Get-AbrVbrBackupJobsRP { process { try { - $BackupJobs = Get-VBRBackup | Sort-Object -Property Name - if ($BackupJobs) { + if ($BackupJobs = Get-VBRBackup | Sort-Object -Property Name) { Write-PScriboMessage "Collecting Veeam VBR Restore Point." Section -Style Heading3 'Backup Restore Points' { Paragraph "The following section details per Backup Job restore points." BlankLine foreach ($BackupJob in $BackupJobs) { - $BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob | Sort-Object -Property VMName, CreationTimeUt, Type - if ($BackupJobRestorePoints) { + if ($BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob | Sort-Object -Property VMName, CreationTimeUt, Type) { Section -ExcludeFromTOC -Style NOTOCHeading4 $BackupJob.Name { $RestorePointInfo = @() foreach ($RestorePoint in $BackupJobRestorePoints) { diff --git a/Src/Private/Get-AbrVbrBackupProxy.ps1 b/Src/Private/Get-AbrVbrBackupProxy.ps1 index a1a79a2..a5a526f 100644 --- a/Src/Private/Get-AbrVbrBackupProxy.ps1 +++ b/Src/Private/Get-AbrVbrBackupProxy.ps1 @@ -30,8 +30,7 @@ function Get-AbrVbrBackupProxy { Section -Style Heading3 'Backup Proxies' { Paragraph "The following section provides a summary of the Veeam Backup Proxies" BlankLine - $BackupProxies = Get-VBRViProxy | Sort-Object -Property Name - if ($BackupProxies) { + if ($BackupProxies = Get-VBRViProxy | Sort-Object -Property Name) { Section -Style Heading4 'VMware Backup Proxies' { $OutObj = @() try { @@ -118,8 +117,7 @@ function Get-AbrVbrBackupProxy { Write-PScriboMessage "Hardware Inventory Status set as $($Options.EnableHardwareInventory)." if ($Options.EnableHardwareInventory) { Write-PScriboMessage "Collecting Hardware/Software Inventory Summary." - $BackupProxies = Get-VBRViProxy | Where-Object { $_.Host.Type -eq "Windows" } | Sort-Object -Property Name - if ($BackupProxies) { + if ($BackupProxies = Get-VBRViProxy | Where-Object { $_.Host.Type -eq "Windows" } | Sort-Object -Property Name) { $vSphereVBProxyObj = foreach ($BackupProxy in $BackupProxies) { if (Test-Connection -ComputerName $BackupProxy.Host.Name -Quiet -Count 2) { try { @@ -454,8 +452,7 @@ function Get-AbrVbrBackupProxy { # Hyper-V Backup Prxy information Section # #---------------------------------------------------------------------------------------------# try { - $BackupProxies = Get-VBRHvProxy | Sort-Object -Property Name - if ($BackupProxies) { + if ($BackupProxies = Get-VBRHvProxy | Sort-Object -Property Name) { Section -Style Heading4 'Hyper-V Backup Proxies' { $OutObj = @() if ($InfoLevel.Infrastructure.Proxy -eq 1) { @@ -545,8 +542,7 @@ function Get-AbrVbrBackupProxy { if ($Options.EnableHardwareInventory) { Write-PScriboMessage "Backup Proxy InfoLevel set at $($InfoLevel.Infrastructure.Proxy)." Write-PScriboMessage "Collecting Hardware/Software Inventory Summary." - $BackupProxies = Get-VBRHvProxy | Sort-Object -Property Name - if ($BackupProxies) { + if ($BackupProxies = Get-VBRHvProxy | Sort-Object -Property Name) { $HyperVBProxyObj = foreach ($BackupProxy in $BackupProxies) { if (Test-Connection -ComputerName $BackupProxy.Host.Name -Quiet -Count 2) { try { diff --git a/Src/Private/Get-AbrVbrBackupServerCertificate.ps1 b/Src/Private/Get-AbrVbrBackupServerCertificate.ps1 index c479518..5f0ce4d 100644 --- a/Src/Private/Get-AbrVbrBackupServerCertificate.ps1 +++ b/Src/Private/Get-AbrVbrBackupServerCertificate.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrBackupServerCertificate { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrBackupServerCertificate { process { try { - $TLSSettings = Get-VBRBackupServerCertificate - if ($TLSSettings) { + if ($TLSSettings = Get-VBRBackupServerCertificate) { Section -Style Heading4 'Backup Server TLS Certificate' { $OutObj = @() try { diff --git a/Src/Private/Get-AbrVbrBackupServerInfo.ps1 b/Src/Private/Get-AbrVbrBackupServerInfo.ps1 index 46749f3..467f601 100644 --- a/Src/Private/Get-AbrVbrBackupServerInfo.ps1 +++ b/Src/Private/Get-AbrVbrBackupServerInfo.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrBackupServerInfo { process { try { - $script:BackupServers = Get-VBRServer -Type Local - if (($BackupServers).count -gt 0) { + if ($script:BackupServers = Get-VBRServer -Type Local) { Section -Style Heading3 'Backup Server' { $OutObj = @() try { @@ -123,17 +122,10 @@ function Get-AbrVbrBackupServerInfo { Paragraph "Health Check:" -Bold -Underline BlankLine Paragraph { - Text 'Best Practice:' -Bold - - Text 'For the most secure deployment, Veeam recommend three options:' + Text "Best Practice:" -Bold + Text "When setting up the Veeam Availability infrastructure keep in mind the principle that a data protection system should not rely on the environment it is meant to protect in any way! This is because when your production environment goes down along with its domain controllers, it will impact your ability to perform actual restores due to the backup server's dependency on those domain controllers for backup console authentication, DNS for name resolution, etc." } BlankLine - Paragraph '1. Add the Veeam components to a management domain that resides in a separate Active Directory Forest and protect the administrative accounts with two-factor authentication mechanics.' - - Paragraph '2. Add the Veeam components to a separate workgroup and place the components on a separate network where applicable.' - - Paragraph '3. Add the Veeam components to the production domain but make sure the accounts with administrative privileges are protected with two-factor authentication.' - BlankLine Paragraph { Text 'Reference:' -Bold Text 'https://bp.veeam.com/vbr/Security/Security_domains.html' @@ -149,11 +141,10 @@ function Get-AbrVbrBackupServerInfo { if ($Options.EnableHardwareInventory) { $BackupServer = Get-VBRServer -Type Local Write-PScriboMessage "Collecting Backup Server Inventory Summary from $($BackupServer.Name)." - $HW = Invoke-Command -Session $PssSession -ScriptBlock { Get-ComputerInfo } $License = Get-CimInstance -Query 'Select * from SoftwareLicensingProduct' -CimSession $CimSession | Where-Object { $_.LicenseStatus -eq 1 } $HWCPU = Get-CimInstance -Class Win32_Processor -CimSession $CimSession $HWBIOS = Get-CimInstance -Class Win32_Bios -CimSession $CimSession - if ($HW) { + if ($HW = Invoke-Command -Session $PssSession -ScriptBlock { Get-ComputerInfo }) { Section -Style Heading4 'Hardware & Software Inventory' { $OutObj = @() $inObj = [ordered] @{ @@ -477,10 +468,9 @@ function Get-AbrVbrBackupServerInfo { try { Write-PScriboMessage "Infrastructure Backup Server InfoLevel set at $($InfoLevel.Infrastructure.BackupServer)." if ($InfoLevel.Infrastructure.BackupServer -ge 2) { - $Available = Invoke-Command -Session $PssSession -ScriptBlock { Get-Service "W32Time" | Select-Object DisplayName, Name, Status } Write-PScriboMessage "Collecting Backup Server Service Summary from $($BackupServer.Name)." $Services = Invoke-Command -Session $PssSession -ScriptBlock { Get-Service Veeam* } - if ($Available) { + if ($Available = Invoke-Command -Session $PssSession -ScriptBlock { Get-Service "W32Time" | Select-Object DisplayName, Name, Status }) { Section -Style Heading4 "HealthCheck - Services Status" { $OutObj = @() foreach ($Service in $Services) { diff --git a/Src/Private/Get-AbrVbrBackupToTape.ps1 b/Src/Private/Get-AbrVbrBackupToTape.ps1 index 0a28ed3..ceefe27 100644 --- a/Src/Private/Get-AbrVbrBackupToTape.ps1 +++ b/Src/Private/Get-AbrVbrBackupToTape.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrBackupToTape { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrBackupToTape { process { try { - $TBkjobs = Get-VBRTapeJob | Where-Object { $_.Type -eq 'BackupToTape' } | Sort-Object -Property Name - if ($TBkjobs) { + if ($TBkjobs = Get-VBRTapeJob | Where-Object { $_.Type -eq 'BackupToTape' } | Sort-Object -Property Name) { Section -Style Heading3 'Backup To Tape Job Configuration' { Paragraph "The following section details the configuration about the backup to tape jobs ." BlankLine diff --git a/Src/Private/Get-AbrVbrBackupjob.ps1 b/Src/Private/Get-AbrVbrBackupjob.ps1 index 3bb6eeb..6575afe 100644 --- a/Src/Private/Get-AbrVbrBackupjob.ps1 +++ b/Src/Private/Get-AbrVbrBackupjob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrBackupjob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrBackupjob { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -ne 'Windows Agent Backup' -and $_.TypeToString -ne 'Hyper-V Replication' -and $_.TypeToString -ne 'VMware Replication' } | Sort-Object -Property Name - if ($Bkjobs) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -ne 'Windows Agent Backup' -and $_.TypeToString -ne 'Hyper-V Replication' -and $_.TypeToString -ne 'VMware Replication' } | Sort-Object -Property Name) { $OutObj = @() foreach ($Bkjob in $Bkjobs) { try { @@ -103,67 +102,67 @@ function Get-AbrVbrBackupjob { Section -ExcludeFromTOC -Style NOTOCHeading4 'Backup Job Status' { $OutObj | Sort-Object -Property Name | Table @TableParams } - if ($Bkjobs) { - try { - Section -ExcludeFromTOC -Style NOTOCHeading4 'Backup Jobs Duration' { - $OutObj = @() - foreach ($Bkjob in $Bkjobs) { - try { - $BKJobSession = Get-VBRSession -Job $Bkjob | Select-Object -First 10 - $Duration = $Null - $StandardDeviation = $Null - if ($BKJobSession) { - try { - $Duration = Get-AvgTimeDuration -InputObject $BKJobSession -StartTime 'CreationTime' -EndTime 'EndTime' - } catch { - Out-Null - } - } - if ($BKJobSession) { - try { - $StandardDeviation = (Get-StrdDevDuration -JobSessions $BKJobSession).StandardDeviation - } catch { - Out-Null - } - } - $inObj = [ordered] @{ - 'Name' = $Bkjob.Name - 'Last Backup Duration' = Switch ([string]::IsNullOrEmpty($BKJobSession)) { - $true { '--' } - $false { Get-TimeDuration -TimeSpan (New-TimeSpan -Start $BKJobSession[0].CreationTime -End $BKJobSession[0].EndTime) } - } - 'Last 10 Backup AVG Duration' = Switch ([string]::IsNullOrEmpty($Duration)) { - $true { '--' } - $false { $Duration } - default { 'Unknown' } - } - 'Standard Deviation' = Switch ([string]::IsNullOrEmpty($StandardDeviation)) { - $true { '--' } - $false { $StandardDeviation } - default { 'Unknown' } - } - } - $OutObj += [pscustomobject]$inObj - } catch { - Write-PScriboMessage -IsWarning "Backup Jobs $($Bkjob.Name) Time Table: $($_.Exception.Message)" - } - } + # Disable until fixing code issues + # if ($Bkjobs) { + # try { + # Section -ExcludeFromTOC -Style NOTOCHeading4 'Backup Jobs Duration' { + # $OutObj = @() + # foreach ($Bkjob in $Bkjobs) { + # try { + # $Duration = $Null + # $StandardDeviation = $Null + # if ($BKJobSession = Get-VBRSession -Job $Bkjob | Select-Object -First 10) { + # try { + # $Duration = Get-AvgTimeDuration -InputObject $BKJobSession -StartTime 'CreationTime' -EndTime 'EndTime' + # } catch { + # Out-Null + # } + # } + # if ($BKJobSession) { + # try { + # $StandardDeviation = (Get-StrdDevDuration -JobSessions $BKJobSession).StandardDeviation + # } catch { + # Out-Null + # } + # } + # $inObj = [ordered] @{ + # 'Name' = $Bkjob.Name + # 'Last Backup Duration' = Switch ([string]::IsNullOrEmpty($BKJobSession)) { + # $true { '--' } + # $false { Get-TimeDuration -TimeSpan (New-TimeSpan -Start $BKJobSession[0].CreationTime -End $BKJobSession[0].EndTime) } + # } + # 'Last 10 Backup AVG Duration' = Switch ([string]::IsNullOrEmpty($Duration)) { + # $true { '--' } + # $false { $Duration } + # default { 'Unknown' } + # } + # 'Standard Deviation' = Switch ([string]::IsNullOrEmpty($StandardDeviation)) { + # $true { '--' } + # $false { $StandardDeviation } + # default { 'Unknown' } + # } + # } + # $OutObj += [pscustomobject]$inObj + # } catch { + # Write-PScriboMessage -IsWarning "Backup Jobs $($Bkjob.Name) Time Table: $($_.Exception.Message)" + # } + # } - $TableParams = @{ - Name = "Backup Jobs Time - $VeeamBackupServer" - List = $false - ColumnWidths = 40, 20, 20, 20 - } - if ($Report.ShowTableCaptions) { - $TableParams['Caption'] = "- $($TableParams.Name)" - } + # $TableParams = @{ + # Name = "Backup Jobs Time - $VeeamBackupServer" + # List = $false + # ColumnWidths = 40, 20, 20, 20 + # } + # if ($Report.ShowTableCaptions) { + # $TableParams['Caption'] = "- $($TableParams.Name)" + # } - $OutObj | Sort-Object -Property Name | Table @TableParams - } - } catch { - Write-PScriboMessage -IsWarning "Backup Jobs Time Section: $($_.Exception.Message)" - } - } + # $OutObj | Sort-Object -Property Name | Table @TableParams + # } + # } catch { + # Write-PScriboMessage -IsWarning "Backup Jobs Time Section: $($_.Exception.Message)" + # } + # } } } } diff --git a/Src/Private/Get-AbrVbrBackupjobHyperV.ps1 b/Src/Private/Get-AbrVbrBackupjobHyperV.ps1 index dea7391..81db413 100644 --- a/Src/Private/Get-AbrVbrBackupjobHyperV.ps1 +++ b/Src/Private/Get-AbrVbrBackupjobHyperV.ps1 @@ -26,15 +26,13 @@ function Get-AbrVbrBackupjobHyperV { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq "Hyper-V Backup" -or $_.TypeToString -eq "Hyper-V Backup Copy" } | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq "Hyper-V Backup" -or $_.TypeToString -eq "Hyper-V Backup Copy" } | Sort-Object -Property Name) { Section -Style Heading3 'Hyper-V Backup Jobs Configuration' { Paragraph "The following section details the configuration of the Hyper-V type backup jobs." BlankLine $OutObj = @() try { - $VMcounts = Get-VBRBackup | Where-Object { $_.TypeToString -eq "Hyper-V Backup" -or $_.TypeToString -eq "Hyper-V Backup Copy" } - if ($VMcounts) { + if ($VMcounts = Get-VBRBackup | Where-Object { $_.TypeToString -eq "Hyper-V Backup" -or $_.TypeToString -eq "Hyper-V Backup Copy" }) { foreach ($VMcount in $VMcounts) { try { Write-PScriboMessage "Discovered $($VMcount.Name) ." diff --git a/Src/Private/Get-AbrVbrBackupjobVMware.ps1 b/Src/Private/Get-AbrVbrBackupjobVMware.ps1 index 59f5c4d..5e56d33 100644 --- a/Src/Private/Get-AbrVbrBackupjobVMware.ps1 +++ b/Src/Private/Get-AbrVbrBackupjobVMware.ps1 @@ -26,15 +26,13 @@ function Get-AbrVbrBackupjobVMware { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq "VMware Backup" -or $_.TypeToString -eq "VMware Backup Copy" -or $_.TypeToString -eq "VM Copy" } | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq "VMware Backup" -or $_.TypeToString -eq "VMware Backup Copy" -or $_.TypeToString -eq "VM Copy" } | Sort-Object -Property Name) { Section -Style Heading3 'VMware Backup Jobs Configuration' { Paragraph "The following section details the configuration of VMware type backup jobs." BlankLine $OutObj = @() try { - $VMcounts = Get-VBRBackup | Where-Object { $_.TypeToString -eq "VMware Backup" -or $_.TypeToString -eq "VMware Backup Copy" -or $_.TypeToString -eq "VM Copy" } - if ($VMcounts) { + if ($VMcounts = Get-VBRBackup | Where-Object { $_.TypeToString -eq "VMware Backup" -or $_.TypeToString -eq "VMware Backup Copy" -or $_.TypeToString -eq "VM Copy" }) { foreach ($VMcount in $VMcounts) { try { Write-PScriboMessage "Discovered $($VMcount.Name) ." @@ -158,16 +156,14 @@ function Get-AbrVbrBackupjobVMware { foreach ($LinkedRepository in $Bkjob.LinkedRepositories.LinkedRepositoryId) { try { Write-PScriboMessage "Discovered $($Bkjob.Name) linked repository." - $Repo = Get-VBRBackupRepository | Where-Object { $_.Id -eq $LinkedRepository } - $ScaleRepo = Get-VBRBackupRepository -ScaleOut | Where-Object { $_.Id -eq $LinkedRepository } - if ($Repo) { + if ($Repo = Get-VBRBackupRepository | Where-Object { $_.Id -eq $LinkedRepository }) { $inObj = [ordered] @{ 'Name' = $Repo.Name 'Type' = "Standard" 'Size' = "$($Repo.GetContainer().CachedTotalSpace.InGigabytes) Gb" } } - if ($ScaleRepo) { + if ($ScaleRepo = Get-VBRBackupRepository -ScaleOut | Where-Object { $_.Id -eq $LinkedRepository }) { $inObj = [ordered] @{ 'Name' = $ScaleRepo.Name 'Type' = "ScaleOut" diff --git a/Src/Private/Get-AbrVbrBackupsRPSummary.ps1 b/Src/Private/Get-AbrVbrBackupsRPSummary.ps1 index 0daad59..06ef28d 100644 --- a/Src/Private/Get-AbrVbrBackupsRPSummary.ps1 +++ b/Src/Private/Get-AbrVbrBackupsRPSummary.ps1 @@ -5,7 +5,7 @@ function Get-AbrVbrBackupsRPSummary { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -31,8 +31,7 @@ function Get-AbrVbrBackupsRPSummary { Write-PScriboMessage "Collecting Veeam VBR Restore Point." $RestorePointInfo = @() foreach ($BackupJob in $BackupJobs) { - $BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob - if ($BackupJobRestorePoints) { + if ($BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob) { try { if ($FullRP = $BackupJobRestorePoints | Where-Object { $_.Type -eq 'Full' -and -Not $_.IsCorrupted -and $_.CompletionTimeUtc -gt $_.CreationTimeUTC }) { try { diff --git a/Src/Private/Get-AbrVbrCloudConnectCG.ps1 b/Src/Private/Get-AbrVbrCloudConnectCG.ps1 index cd01ace..51a433d 100644 --- a/Src/Private/Get-AbrVbrCloudConnectCG.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectCG.ps1 @@ -27,8 +27,7 @@ function Get-AbrVbrCloudConnectCG { process { try { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudObjects = Get-VBRCloudGateway | Sort-Object -Property Name - if ($CloudObjects) { + if ($CloudObjects = Get-VBRCloudGateway | Sort-Object -Property Name) { Section -Style Heading3 'Cloud Gateways' { Paragraph "The following section provides summary information about configured Cloud Gateways." BlankLine diff --git a/Src/Private/Get-AbrVbrCloudConnectCert.ps1 b/Src/Private/Get-AbrVbrCloudConnectCert.ps1 index ff49b0e..bafb37c 100644 --- a/Src/Private/Get-AbrVbrCloudConnectCert.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectCert.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectCert { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -27,8 +27,7 @@ function Get-AbrVbrCloudConnectCert { process { try { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudObjects = Get-VBRCloudGatewayCertificate - if ($CloudObjects) { + if ($CloudObjects = Get-VBRCloudGatewayCertificate) { Section -Style Heading3 'Gateway Certificate' { Paragraph "The following section provides information about Cloud Gateways SSL Certificate." BlankLine diff --git a/Src/Private/Get-AbrVbrCloudConnectGP.ps1 b/Src/Private/Get-AbrVbrCloudConnectGP.ps1 index 0791671..bf8b781 100644 --- a/Src/Private/Get-AbrVbrCloudConnectGP.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectGP.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectGP { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -27,8 +27,7 @@ function Get-AbrVbrCloudConnectGP { process { try { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudObjects = Get-VBRCloudGatewayPool | Sort-Object -Property Name - if ($CloudObjects) { + if ($CloudObjects = Get-VBRCloudGatewayPool | Sort-Object -Property Name) { Section -Style Heading3 'Gateways Pools' { Paragraph "The following section provides summary information about configured Cloud Gateways Pools." BlankLine diff --git a/Src/Private/Get-AbrVbrCloudConnectRR.ps1 b/Src/Private/Get-AbrVbrCloudConnectRR.ps1 index e0bcf84..435cf9a 100644 --- a/Src/Private/Get-AbrVbrCloudConnectRR.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectRR.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectRR { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrCloudConnectRR { process { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudObjects = Get-VBRCloudHardwarePlan - if ($CloudObjects) { + if ($CloudObjects = Get-VBRCloudHardwarePlan) { Section -Style Heading3 'Replica Resources' { Paragraph "The following table provides a summary of Replica Resources." BlankLine diff --git a/Src/Private/Get-AbrVbrCloudConnectStatus.ps1 b/Src/Private/Get-AbrVbrCloudConnectStatus.ps1 index a9fc40b..49317f9 100644 --- a/Src/Private/Get-AbrVbrCloudConnectStatus.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectStatus.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrCloudConnectStatus { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrCloudConnectStatus { process { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudConnectInfraStatus = Get-VBRCloudInfrastructureState - if ($CloudConnectInfraStatus) { + if ($CloudConnectInfraStatus = Get-VBRCloudInfrastructureState) { Section -Style Heading3 'Service Status' { Paragraph "The following section provides information about Cloud Gateways SSL Certificate." BlankLine diff --git a/Src/Private/Get-AbrVbrCloudConnectTenant.ps1 b/Src/Private/Get-AbrVbrCloudConnectTenant.ps1 index f4f9f77..46efed8 100644 --- a/Src/Private/Get-AbrVbrCloudConnectTenant.ps1 +++ b/Src/Private/Get-AbrVbrCloudConnectTenant.ps1 @@ -27,8 +27,7 @@ function Get-AbrVbrCloudConnectTenant { process { try { if ($VbrLicenses | Where-Object { $_.CloudConnect -ne "Disabled" }) { - $CloudObjects = Get-VBRCloudTenant | Sort-Object -Property Name - if ($CloudObjects) { + if ($CloudObjects = Get-VBRCloudTenant | Sort-Object -Property Name) { Section -Style Heading3 'Tenants' { Paragraph "The following table provides status information about Cloud Connect Tenants." BlankLine @@ -330,8 +329,7 @@ function Get-AbrVbrCloudConnectTenant { } if ($CloudObject.ReplicationResources.NetworkFailoverResourcesEnabled -or $CloudObject.vCDReplicationResource.TenantNetworkAppliance) { try { - $TenantNetworkAppliances = Get-VBRCloudTenantNetworkAppliance -Tenant $CloudObject - if ($TenantNetworkAppliances) { + if ($TenantNetworkAppliances = Get-VBRCloudTenantNetworkAppliance -Tenant $CloudObject) { Section -ExcludeFromTOC -Style NOTOCHeading6 'Network Extension' { $OutObj = @() foreach ($TenantNetworkAppliance in $TenantNetworkAppliances) { @@ -378,8 +376,7 @@ function Get-AbrVbrCloudConnectTenant { } } try { - $CloudSubTenants = Get-VBRCloudSubTenant | Where-Object { $_.TenantId -eq $CloudObject.Id } | Sort-Object -Property Name - if ($CloudSubTenants) { + if ($CloudSubTenants = Get-VBRCloudSubTenant | Where-Object { $_.TenantId -eq $CloudObject.Id } | Sort-Object -Property Name) { Section -ExcludeFromTOC -Style NOTOCHeading6 'Sub-Tenants' { $OutObj = @() foreach ($CloudSubTenant in $CloudSubTenants) { diff --git a/Src/Private/Get-AbrVbrConfigurationBackupSetting.ps1 b/Src/Private/Get-AbrVbrConfigurationBackupSetting.ps1 index daa3586..b0c0c13 100644 --- a/Src/Private/Get-AbrVbrConfigurationBackupSetting.ps1 +++ b/Src/Private/Get-AbrVbrConfigurationBackupSetting.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrConfigurationBackupSetting { process { try { - $BackupSettings = Get-VBRConfigurationBackupJob | Sort-Object -Property Name - if ($BackupSettings) { + if ($BackupSettings = Get-VBRConfigurationBackupJob | Sort-Object -Property Name) { Section -Style Heading4 'Configuration Backup' { $OutObj = @() try { diff --git a/Src/Private/Get-AbrVbrCredential.ps1 b/Src/Private/Get-AbrVbrCredential.ps1 index 37eb51a..602ddd3 100644 --- a/Src/Private/Get-AbrVbrCredential.ps1 +++ b/Src/Private/Get-AbrVbrCredential.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrCredential { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrCredential { process { try { - $Credentials = Get-VBRCredentials - if ($Credentials) { + if ($Credentials = Get-VBRCredentials) { Section -Style Heading3 'Security Credentials' { Paragraph "The following table provide information about the credentials managed by Veeam Backup & Replication." BlankLine @@ -60,8 +59,7 @@ function Get-AbrVbrCredential { } $OutObj | Sort-Object -Property 'Name' | Table @TableParams try { - $CloudCredentials = Get-VBRCloudProviderCredentials - if (($CloudCredentials).count -gt 0) { + if ($CloudCredentials = Get-VBRCloudProviderCredentials) { Section -Style Heading3 'Service Provider Credentials' { Paragraph "The following table provide information about the service provider credentials managed by Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrEmailNotificationSetting.ps1 b/Src/Private/Get-AbrVbrEmailNotificationSetting.ps1 index 71f39fa..6d6d3e3 100644 --- a/Src/Private/Get-AbrVbrEmailNotificationSetting.ps1 +++ b/Src/Private/Get-AbrVbrEmailNotificationSetting.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrEmailNotificationSetting { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.0 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrEmailNotificationSetting { process { try { - $EmailSettings = Get-VBRMailNotificationConfiguration - if ($EmailSettings) { + if ($EmailSettings = Get-VBRMailNotificationConfiguration) { Section -Style Heading4 'Email Notification' { $OutObj = @() foreach ($EmailSetting in $EmailSettings) { diff --git a/Src/Private/Get-AbrVbrEnterpriseManagerInfo.ps1 b/Src/Private/Get-AbrVbrEnterpriseManagerInfo.ps1 index 67a2227..04b3654 100644 --- a/Src/Private/Get-AbrVbrEnterpriseManagerInfo.ps1 +++ b/Src/Private/Get-AbrVbrEnterpriseManagerInfo.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrEnterpriseManagerInfo { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrEnterpriseManagerInfo { process { try { - $BackupServers = Get-VBRServer -Type Local - if ($BackupServers) { + if ($BackupServers = Get-VBRServer -Type Local) { Section -Style Heading3 'Enterprise Manager Information' { Paragraph "The following table details information about Veeam Enterprise Manager configuration status" BlankLine diff --git a/Src/Private/Get-AbrVbrFileShareBackupjob.ps1 b/Src/Private/Get-AbrVbrFileShareBackupjob.ps1 index 04e2513..ee76df6 100644 --- a/Src/Private/Get-AbrVbrFileShareBackupjob.ps1 +++ b/Src/Private/Get-AbrVbrFileShareBackupjob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrFileShareBackupjob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.3 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrFileShareBackupjob { process { try { - $FSBkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -like 'File Backup' -or $_.TypeToString -like 'Object Storage Backup' } - if ($FSBkjobs.count -gt 0) { + if ($FSBkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -like 'File Backup' -or $_.TypeToString -like 'Object Storage Backup' }) { if ($VbrVersion -lt 12.1) { $BSName = 'File Share Backup Jobs' } else { diff --git a/Src/Private/Get-AbrVbrFileShareBackupjobConf.ps1 b/Src/Private/Get-AbrVbrFileShareBackupjobConf.ps1 index b4f075d..fc06803 100644 --- a/Src/Private/Get-AbrVbrFileShareBackupjobConf.ps1 +++ b/Src/Private/Get-AbrVbrFileShareBackupjobConf.ps1 @@ -25,8 +25,7 @@ function Get-AbrVbrFileShareBackupjobConf { } process { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -like 'File Backup' -or $_.TypeToString -like 'Object Storage Backup' } | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -like 'File Backup' -or $_.TypeToString -like 'Object Storage Backup' } | Sort-Object -Property Name) { if ($VbrVersion -lt 12.1) { $BSName = 'File Share Backup Jobs Configuration' } else { diff --git a/Src/Private/Get-AbrVbrFileSharesInfo.ps1 b/Src/Private/Get-AbrVbrFileSharesInfo.ps1 index f8a6766..21c2f55 100644 --- a/Src/Private/Get-AbrVbrFileSharesInfo.ps1 +++ b/Src/Private/Get-AbrVbrFileSharesInfo.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrFileSharesInfo { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.3 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,8 +25,7 @@ function Get-AbrVbrFileSharesInfo { } process { - $ShareObjs = Get-VBRNASServer -WarningAction SilentlyContinue - if ($ShareObjs) { + if ($ShareObjs = Get-VBRNASServer -WarningAction SilentlyContinue) { Section -Style Heading3 'File Shares' { Paragraph "The following table provides a summary about the file shares backed-up by Veeam Server $(((Get-VBRServerSession).Server))." BlankLine diff --git a/Src/Private/Get-AbrVbrFileToTape.ps1 b/Src/Private/Get-AbrVbrFileToTape.ps1 index 9ca15b0..9c857f4 100644 --- a/Src/Private/Get-AbrVbrFileToTape.ps1 +++ b/Src/Private/Get-AbrVbrFileToTape.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrFileToTape { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrFileToTape { process { try { - $TBkjobs = Get-VBRTapeJob | Where-Object { $_.Type -eq 'FileToTape' } | Sort-Object -Property Name - if ($TBkjobs) { + if ($TBkjobs = Get-VBRTapeJob | Where-Object { $_.Type -eq 'FileToTape' } | Sort-Object -Property Name) { Section -Style Heading3 'File To Tape Job Configuration' { Paragraph "The following section details the configuration about file to tape jobs." BlankLine diff --git a/Src/Private/Get-AbrVbrGlobalExclusion.ps1 b/Src/Private/Get-AbrVbrGlobalExclusion.ps1 index d827659..b6c64e9 100644 --- a/Src/Private/Get-AbrVbrGlobalExclusion.ps1 +++ b/Src/Private/Get-AbrVbrGlobalExclusion.ps1 @@ -5,7 +5,7 @@ function Get-AbrVbrGlobalExclusion { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,9 +25,7 @@ function Get-AbrVbrGlobalExclusion { process { try { - $MalwareDetectionExclusions = Get-VBRMalwareDetectionExclusion - $VMExclusions = Get-VBRVMExclusion - if ($MalwareDetectionExclusions) { + if ($MalwareDetectionExclusions = Get-VBRMalwareDetectionExclusion) { Section -Style Heading4 'Global Exclusions' { try { Write-PScriboMessage "Discovering Veeam VBR Malware Detection Exclusions settings information from $System." @@ -56,7 +54,7 @@ function Get-AbrVbrGlobalExclusion { } catch { Write-PScriboMessage -IsWarning "Malware Detection Exclusions Section: $($_.Exception.Message)" } - if ($VMExclusions) { + if ($VMExclusions = Get-VBRVMExclusion) { try { Write-PScriboMessage "Discovering Veeam VBR VM Exclusions settings information from $System." Section -ExcludeFromTOC -Style Heading5 'VM Exclusions' { diff --git a/Src/Private/Get-AbrVbrGlobalNotificationSetting.ps1 b/Src/Private/Get-AbrVbrGlobalNotificationSetting.ps1 index c2c3301..9945924 100644 --- a/Src/Private/Get-AbrVbrGlobalNotificationSetting.ps1 +++ b/Src/Private/Get-AbrVbrGlobalNotificationSetting.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrGlobalNotificationSetting { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.0 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrGlobalNotificationSetting { process { try { - $GlobalNotifications = Get-VBRGlobalNotificationOptions - if ($GlobalNotifications) { + if ($GlobalNotifications = Get-VBRGlobalNotificationOptions) { Section -Style Heading4 'Global Notifications' { Section -ExcludeFromTOC -Style NOTOCHeading5 'Backup Storage' { $OutObj = @() diff --git a/Src/Private/Get-AbrVbrHistorySetting.ps1 b/Src/Private/Get-AbrVbrHistorySetting.ps1 index 6a880a3..d6e81f5 100644 --- a/Src/Private/Get-AbrVbrHistorySetting.ps1 +++ b/Src/Private/Get-AbrVbrHistorySetting.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrHistorySetting { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrHistorySetting { process { try { - $HistorySettings = Get-VBRHistoryOptions - if ($HistorySettings) { + if ($HistorySettings = Get-VBRHistoryOptions) { Section -Style Heading4 'History Retention' { $OutObj = @() $inObj = [ordered] @{ diff --git a/Src/Private/Get-AbrVbrIOControlSetting.ps1 b/Src/Private/Get-AbrVbrIOControlSetting.ps1 index 47043f7..7d10bf8 100644 --- a/Src/Private/Get-AbrVbrIOControlSetting.ps1 +++ b/Src/Private/Get-AbrVbrIOControlSetting.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrIOControlSetting { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -27,8 +27,7 @@ function Get-AbrVbrIOControlSetting { process { try { if ($VbrLicenses | Where-Object { $_.Edition -in @("EnterprisePlus", "Enterprise") -and $_.Status -ne "Expired" }) { - $StorageLatencyControls = Get-VBRStorageLatencyControlOptions - if ($StorageLatencyControls) { + if ($StorageLatencyControls = Get-VBRStorageLatencyControlOptions) { Section -Style Heading4 'Storage Latency Control' { $OutObj = @() foreach ($StorageLatencyControl in $StorageLatencyControls) { diff --git a/Src/Private/Get-AbrVbrKMSInfo.ps1 b/Src/Private/Get-AbrVbrKMSInfo.ps1 index dfdb85f..30f7fef 100644 --- a/Src/Private/Get-AbrVbrKMSInfo.ps1 +++ b/Src/Private/Get-AbrVbrKMSInfo.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrKMSInfo { process { try { - $KMSServers = Get-VBRKMSServer | Sort-Object -Property Name - if ($KMSServers) { + if ($KMSServers = Get-VBRKMSServer | Sort-Object -Property Name) { Section -Style Heading3 'Key Management Servers' { Paragraph "The following table provide information about the kms configured in Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrLocation.ps1 b/Src/Private/Get-AbrVbrLocation.ps1 index 3e3382b..bd5be9c 100644 --- a/Src/Private/Get-AbrVbrLocation.ps1 +++ b/Src/Private/Get-AbrVbrLocation.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrLocation { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrLocation { process { try { - $Locations = Get-VBRLocation - if ($Locations) { + if ($Locations = Get-VBRLocation) { Section -Style Heading3 'Geographical Locations' { Paragraph "The following section provide a summary about geographical locations." BlankLine diff --git a/Src/Private/Get-AbrVbrManagedServer.ps1 b/Src/Private/Get-AbrVbrManagedServer.ps1 index 1ad62f3..d14adb5 100644 --- a/Src/Private/Get-AbrVbrManagedServer.ps1 +++ b/Src/Private/Get-AbrVbrManagedServer.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrManagedServer { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrManagedServer { process { try { - $ManagedServers = Get-VBRServer - if ($ManagedServers) { + if ($ManagedServers = Get-VBRServer) { Section -Style Heading3 'Virtualization Servers and Hosts' { $OutObj = @() foreach ($ManagedServer in $ManagedServers) { diff --git a/Src/Private/Get-AbrVbrNDMPInfo.ps1 b/Src/Private/Get-AbrVbrNDMPInfo.ps1 index 3797661..f116ff4 100644 --- a/Src/Private/Get-AbrVbrNDMPInfo.ps1 +++ b/Src/Private/Get-AbrVbrNDMPInfo.ps1 @@ -27,8 +27,7 @@ function Get-AbrVbrNDMPInfo { process { try { if ($VbrLicenses | Where-Object { $_.Edition -in @("EnterprisePlus", "Enterprise") -and $_.Status -ne "Expired" }) { - $NDMPObjs = Get-VBRNDMPServer | Sort-Object -Property Name - if ($NDMPObjs) { + if ($NDMPObjs = Get-VBRNDMPServer | Sort-Object -Property Name) { Section -Style Heading3 'NDMP Servers' { $OutObj = @() try { diff --git a/Src/Private/Get-AbrVbrNetworkTrafficRule.ps1 b/Src/Private/Get-AbrVbrNetworkTrafficRule.ps1 index c202323..8bebd7b 100644 --- a/Src/Private/Get-AbrVbrNetworkTrafficRule.ps1 +++ b/Src/Private/Get-AbrVbrNetworkTrafficRule.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrNetworkTrafficRule { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.6 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,9 +26,7 @@ function Get-AbrVbrNetworkTrafficRule { process { try { - $TrafficOptions = Get-VBRNetworkTrafficRuleOptions - $TrafficRules = Get-VBRNetworkTrafficRule - if ($TrafficOptions) { + if ($TrafficOptions = Get-VBRNetworkTrafficRuleOptions) { Section -Style Heading4 'Network Traffic Rules Options' { Paragraph "The following section details network traffic rules options configured on Veeam Backup & Replication." BlankLine @@ -50,7 +48,7 @@ function Get-AbrVbrNetworkTrafficRule { $TableParams['Caption'] = "- $($TableParams.Name)" } $OutObj | Table @TableParams - if ($TrafficRules) { + if ($TrafficRules = Get-VBRNetworkTrafficRule) { Section -Style Heading5 'Network Traffic Rule' { Paragraph "The following section details network traffic rules settings configured on Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrObjectRepository.ps1 b/Src/Private/Get-AbrVbrObjectRepository.ps1 index c024ed8..af35d10 100644 --- a/Src/Private/Get-AbrVbrObjectRepository.ps1 +++ b/Src/Private/Get-AbrVbrObjectRepository.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrObjectRepository { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrObjectRepository { process { try { - $ObjectRepos = Get-VBRObjectStorageRepository | Sort-Object -Property Name - if ($ObjectRepos) { + if ($ObjectRepos = Get-VBRObjectStorageRepository | Sort-Object -Property Name) { Section -Style Heading3 'Object Storage Repository' { Paragraph "The following section provides a summary about the Veeam Object Storage Repository." BlankLine @@ -174,8 +173,7 @@ function Get-AbrVbrObjectRepository { # Archive Object Storage Repository Section # #---------------------------------------------------------------------------------------------# try { - $ObjectRepoArchives = Get-VBRArchiveObjectStorageRepository | Sort-Object -Property Name - if ($ObjectRepoArchives) { + if ($ObjectRepoArchives = Get-VBRArchiveObjectStorageRepository | Sort-Object -Property Name) { Section -Style Heading3 "Archive Object Storage Repository" { Paragraph "The following section provides detailed information about Archive Object Storage Backup Repository" BlankLine diff --git a/Src/Private/Get-AbrVbrReplFailoverPlan.ps1 b/Src/Private/Get-AbrVbrReplFailoverPlan.ps1 index 59972a5..8aa4866 100644 --- a/Src/Private/Get-AbrVbrReplFailoverPlan.ps1 +++ b/Src/Private/Get-AbrVbrReplFailoverPlan.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrReplFailoverPlan { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,8 +25,7 @@ function Get-AbrVbrReplFailoverPlan { } process { - $FailOverPlans = Get-VBRFailoverPlan | Sort-Object -Property Name - if ($FailOverPlans) { + if ($FailOverPlans = Get-VBRFailoverPlan | Sort-Object -Property Name) { Section -Style Heading3 'Failover Plans' { Paragraph "The following section details failover plan information from Veeam Server $(((Get-VBRServerSession).Server))." $OutObj = @() diff --git a/Src/Private/Get-AbrVbrReplReplica.ps1 b/Src/Private/Get-AbrVbrReplReplica.ps1 index 0511df2..307ec6d 100644 --- a/Src/Private/Get-AbrVbrReplReplica.ps1 +++ b/Src/Private/Get-AbrVbrReplReplica.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrReplReplica { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrReplReplica { process { try { - $Replicas = Get-VBRReplica | Sort-Object -Property VmName - if ($Replicas) { + if ($Replicas = Get-VBRReplica | Sort-Object -Property VmName) { if ($InfoLevel.Replication.Replica -eq 1) { Section -Style Heading3 'Replicas' { Paragraph "The following section details replica information from Veeam Server $(((Get-VBRServerSession).Server))." diff --git a/Src/Private/Get-AbrVbrRepljob.ps1 b/Src/Private/Get-AbrVbrRepljob.ps1 index 651e628..f72b847 100644 --- a/Src/Private/Get-AbrVbrRepljob.ps1 +++ b/Src/Private/Get-AbrVbrRepljob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrRepljob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrRepljob { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'VMware Replication' -or $_.TypeToString -eq 'Hyper-V Replication' } | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'VMware Replication' -or $_.TypeToString -eq 'Hyper-V Replication' } | Sort-Object -Property Name) { Section -Style Heading3 'Replication Jobs' { Paragraph "The following section provide a summary about replication jobs" BlankLine diff --git a/Src/Private/Get-AbrVbrRepljobHyperV.ps1 b/Src/Private/Get-AbrVbrRepljobHyperV.ps1 index b469cb5..cbd1fab 100644 --- a/Src/Private/Get-AbrVbrRepljobHyperV.ps1 +++ b/Src/Private/Get-AbrVbrRepljobHyperV.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrRepljobHyperV { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'Hyper-V Replication' } | Sort-Object -Property Name - if (($Bkjobs).count -gt 0) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'Hyper-V Replication' } | Sort-Object -Property Name) { Section -Style Heading3 'Hyper-V Replication Jobs Configuration' { Paragraph "The following section details the configuration about Hyper-V replication jobs." BlankLine diff --git a/Src/Private/Get-AbrVbrRepljobVMware.ps1 b/Src/Private/Get-AbrVbrRepljobVMware.ps1 index 0b94f1d..7944aa7 100644 --- a/Src/Private/Get-AbrVbrRepljobVMware.ps1 +++ b/Src/Private/Get-AbrVbrRepljobVMware.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrRepljobVMware { process { try { - $Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'VMware Replication' } | Sort-Object -Property Name - if ($Bkjobs) { + if ($Bkjobs = Get-VBRJob -WarningAction SilentlyContinue | Where-Object { $_.TypeToString -eq 'VMware Replication' } | Sort-Object -Property Name) { Section -Style Heading3 'VMware Replication Jobs Configuration' { Paragraph "The following section details the configuration abut VMware type backup jobs." BlankLine diff --git a/Src/Private/Get-AbrVbrScaleOutRepository.ps1 b/Src/Private/Get-AbrVbrScaleOutRepository.ps1 index c1bfc10..ee5d447 100644 --- a/Src/Private/Get-AbrVbrScaleOutRepository.ps1 +++ b/Src/Private/Get-AbrVbrScaleOutRepository.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrScaleOutRepository { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.6 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrScaleOutRepository { process { try { - $BackupRepos = Get-VBRBackupRepository -ScaleOut | Sort-Object -Property Name - if ($BackupRepos) { + if ($BackupRepos = Get-VBRBackupRepository -ScaleOut | Sort-Object -Property Name) { Section -Style Heading3 'ScaleOut Backup Repository' { Paragraph "The following section provides a summary about ScaleOut Backup Repository" BlankLine diff --git a/Src/Private/Get-AbrVbrStorageIsilon.ps1 b/Src/Private/Get-AbrVbrStorageIsilon.ps1 index a6b13db..1114a90 100644 --- a/Src/Private/Get-AbrVbrStorageIsilon.ps1 +++ b/Src/Private/Get-AbrVbrStorageIsilon.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrStorageIsilon { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,8 +25,7 @@ function Get-AbrVbrStorageIsilon { } process { - $IsilonHosts = Get-VBRIsilonHost - if ($IsilonHosts) { + if ($IsilonHosts = Get-VBRIsilonHost) { Section -Style Heading3 'Dell Isilon Storage' { Paragraph "The following section details information about Dell storage infrastructure." BlankLine @@ -65,8 +64,7 @@ function Get-AbrVbrStorageIsilon { $OutObj | Table @TableParams if ($InfoLevel.Storage.Isilon -ge 2) { try { - $IsilonVols = Get-VBRIsilonVolume -Host $IsilonHost - if ($IsilonVols) { + if ($IsilonVols = Get-VBRIsilonVolume -Host $IsilonHost) { Section -Style NOTOCHeading5 -ExcludeFromTOC 'Volumes' { $OutObj = @() foreach ($IsilonVol in $IsilonVols) { diff --git a/Src/Private/Get-AbrVbrStorageOntap.ps1 b/Src/Private/Get-AbrVbrStorageOntap.ps1 index e1237cb..aeeb15e 100644 --- a/Src/Private/Get-AbrVbrStorageOntap.ps1 +++ b/Src/Private/Get-AbrVbrStorageOntap.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrStorageOntap { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,8 +25,7 @@ function Get-AbrVbrStorageOntap { } process { - $OntapHosts = Get-NetAppHost - if ($OntapHosts) { + if ($OntapHosts = Get-NetAppHost) { Section -Style Heading3 'NetApp Ontap Storage' { Paragraph "The following section details information about NetApp storage infrastructure." BlankLine diff --git a/Src/Private/Get-AbrVbrSureBackupjob.ps1 b/Src/Private/Get-AbrVbrSureBackupjob.ps1 index a84624e..6c67e37 100644 --- a/Src/Private/Get-AbrVbrSureBackupjob.ps1 +++ b/Src/Private/Get-AbrVbrSureBackupjob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrSureBackupjob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrSureBackupjob { process { try { - $SBkjobs = Get-VBRSureBackupJob | Sort-Object -Property 'Job Name' - if ($SBkjobs) { + if ($SBkjobs = Get-VBRSureBackupJob | Sort-Object -Property 'Job Name') { Section -Style Heading3 'SureBackup Jobs' { Paragraph "The following section list surebackup jobs created in Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrSureBackupjobconf.ps1 b/Src/Private/Get-AbrVbrSureBackupjobconf.ps1 index dd7bd71..b3270f0 100644 --- a/Src/Private/Get-AbrVbrSureBackupjobconf.ps1 +++ b/Src/Private/Get-AbrVbrSureBackupjobconf.ps1 @@ -26,8 +26,7 @@ function Get-AbrVbrSureBackupjobconf { process { try { - $SBkjobs = Get-VBRSureBackupJob | Sort-Object -Property Name - if ($SBkjobs) { + if ($SBkjobs = Get-VBRSureBackupJob | Sort-Object -Property Name) { Section -Style Heading3 'SureBackup Job Configuration' { Paragraph "The following section provide detailed jobs configuration about Surebackup." BlankLine diff --git a/Src/Private/Get-AbrVbrTapeBackupJobsRP.ps1 b/Src/Private/Get-AbrVbrTapeBackupJobsRP.ps1 index acc2779..66613e4 100644 --- a/Src/Private/Get-AbrVbrTapeBackupJobsRP.ps1 +++ b/Src/Private/Get-AbrVbrTapeBackupJobsRP.ps1 @@ -5,7 +5,7 @@ function Get-AbrVbrTapeBackupJobsRP { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -24,15 +24,13 @@ function Get-AbrVbrTapeBackupJobsRP { process { try { - $BackupJobs = Get-VBRTapeBackup -WarningAction SilentlyContinue | Sort-Object -Property Name - if ($BackupJobs) { + if ($BackupJobs = Get-VBRTapeBackup -WarningAction SilentlyContinue | Sort-Object -Property Name) { Write-PScriboMessage "Collecting Veeam VBR Tape Restore Point." Section -Style Heading3 'Tape Backup Restore Points ' { Paragraph "The following section details per Tape Backup Job restore points." BlankLine foreach ($BackupJob in $BackupJobs) { - $BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob | Sort-Object -Property VMName, CreationTimeUt, Type - if ($BackupJobRestorePoints) { + if ($BackupJobRestorePoints = Get-VBRRestorePoint -Backup $BackupJob | Sort-Object -Property VMName, CreationTimeUt, Type) { Section -ExcludeFromTOC -Style NOTOCHeading4 $BackupJob.Name { $RestorePointInfo = @() foreach ($RestorePoint in $BackupJobRestorePoints) { diff --git a/Src/Private/Get-AbrVbrTapeLibrary.ps1 b/Src/Private/Get-AbrVbrTapeLibrary.ps1 index 1ac66ce..8102070 100644 --- a/Src/Private/Get-AbrVbrTapeLibrary.ps1 +++ b/Src/Private/Get-AbrVbrTapeLibrary.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrTapeLibrary { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrTapeLibrary { process { try { - $TapeObjs = Get-VBRTapeLibrary | Sort-Object -Property Name - if ($TapeObjs) { + if ($TapeObjs = Get-VBRTapeLibrary | Sort-Object -Property Name) { Section -Style Heading3 'Tape Libraries' { Paragraph "The following section provides summary information about Tape Server connected Tape Library." BlankLine @@ -72,8 +71,7 @@ function Get-AbrVbrTapeLibrary { # Tape Drives Section # #---------------------------------------------------------------------------------------------# try { - $DriveObjs = Get-VBRTapeDrive -Library $TapeObj.Id - if ($DriveObjs) { + if ($DriveObjs = Get-VBRTapeDrive -Library $TapeObj.Id) { Write-PScriboMessage "Collecting $($TapeObj.Name) Tape Drives" Section -Style NOTOCHeading5 -ExcludeFromTOC "Tape Drives" { $OutObj = @() @@ -123,8 +121,7 @@ function Get-AbrVbrTapeLibrary { #---------------------------------------------------------------------------------------------# try { if ($InfoLevel.Tape.Library -ge 2) { - $MediumObjs = Get-VBRTapeMedium -Library $TapeObj.Id - if ($MediumObjs) { + if ($MediumObjs = Get-VBRTapeMedium -Library $TapeObj.Id) { Write-PScriboMessage "Collecting $($TapeObj.Name) Tape Medium" Section -Style NOTOCHeading5 -ExcludeFromTOC "Tape Mediums" { $OutObj = @() diff --git a/Src/Private/Get-AbrVbrTapeMediaPool.ps1 b/Src/Private/Get-AbrVbrTapeMediaPool.ps1 index ec8363a..62da1c6 100644 --- a/Src/Private/Get-AbrVbrTapeMediaPool.ps1 +++ b/Src/Private/Get-AbrVbrTapeMediaPool.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrTapeMediaPool { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrTapeMediaPool { process { try { - $PoolObjs = Get-VBRTapeMediaPool - if ($PoolObjs) { + if ($PoolObjs = Get-VBRTapeMediaPool) { #---------------------------------------------------------------------------------------------# # Tape Media Pools Section # #---------------------------------------------------------------------------------------------# @@ -93,8 +92,7 @@ function Get-AbrVbrTapeMediaPool { $OutObj = @() foreach ($TapeLibrary in $PoolObj.GlobalOptions.LibraryId) { try { - $TapeLibraryObj = Get-VBRTapeLibrary -Id $TapeLibrary.Guid - if ($TapeLibraryObj) { + if ($TapeLibraryObj = Get-VBRTapeLibrary -Id $TapeLibrary.Guid) { if ($PoolObj.Type -ne "Custom") { $Capacity = ((Get-VBRTapeMedium -MediaPool $PoolObj.Id | Where-Object { $_.LibraryId -eq $TapeLibrary.Guid }).Capacity | Measure-Object -Sum).Sum $FreeSpace = ((Get-VBRTapeMedium -MediaPool $PoolObj.Id | Where-Object { $_.LibraryId -eq $TapeLibrary.Guid }).Free | Measure-Object -Sum).Sum @@ -174,8 +172,7 @@ function Get-AbrVbrTapeMediaPool { # Tape Media Pools - Tape Medium Sub-Section # #---------------------------------------------------------------------------------------------# try { - $TapeMediums = Get-VBRTapeMedium -MediaPool $PoolObj.Id | Where-Object { $_.LibraryId -eq $TapeLibraryObj.Id } - if ($TapeMediums) { + if ($TapeMediums = Get-VBRTapeMedium -MediaPool $PoolObj.Id | Where-Object { $_.LibraryId -eq $TapeLibraryObj.Id }) { Section -ExcludeFromTOC -Style NOTOCHeading6 'Tape Mediums' { $OutObj = @() if ($TapeMediums) { diff --git a/Src/Private/Get-AbrVbrTapeServer.ps1 b/Src/Private/Get-AbrVbrTapeServer.ps1 index 30cca70..df9a6c7 100644 --- a/Src/Private/Get-AbrVbrTapeServer.ps1 +++ b/Src/Private/Get-AbrVbrTapeServer.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrTapeServer { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrTapeServer { process { try { - $TapeObjs = Get-VBRTapeServer - if ($TapeObjs) { + if ($TapeObjs = Get-VBRTapeServer) { Section -Style Heading3 'Tape Servers' { $OutObj = @() try { diff --git a/Src/Private/Get-AbrVbrTapeVault.ps1 b/Src/Private/Get-AbrVbrTapeVault.ps1 index 498ce7d..a043763 100644 --- a/Src/Private/Get-AbrVbrTapeVault.ps1 +++ b/Src/Private/Get-AbrVbrTapeVault.ps1 @@ -27,8 +27,7 @@ function Get-AbrVbrTapeVault { process { try { if ($VbrLicenses | Where-Object { $_.Edition -in @("EnterprisePlus", "Enterprise") -and $_.Status -ne "Expired" }) { - $TapeObjs = Get-VBRTapeVault | Sort-Object -Property Name - if ($TapeObjs) { + if ($TapeObjs = Get-VBRTapeVault | Sort-Object -Property Name) { Section -Style Heading3 'Tape Vaults' { $OutObj = @() try { diff --git a/Src/Private/Get-AbrVbrTapejob.ps1 b/Src/Private/Get-AbrVbrTapejob.ps1 index 6846197..3ee3018 100644 --- a/Src/Private/Get-AbrVbrTapejob.ps1 +++ b/Src/Private/Get-AbrVbrTapejob.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrTapejob { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrTapejob { process { try { - $TBkjobs = Get-VBRTapeJob | Sort-Object -Property Name - if ($TBkjobs) { + if ($TBkjobs = Get-VBRTapeJob | Sort-Object -Property Name) { Section -Style Heading3 'Tape Backup Jobs' { Paragraph "The following section list tape backup jobs created in Veeam Backup & Replication." BlankLine diff --git a/Src/Private/Get-AbrVbrUnstructuredDataInfo.ps1 b/Src/Private/Get-AbrVbrUnstructuredDataInfo.ps1 index c6b880d..1a5b05f 100644 --- a/Src/Private/Get-AbrVbrUnstructuredDataInfo.ps1 +++ b/Src/Private/Get-AbrVbrUnstructuredDataInfo.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrUnstructuredDataInfo { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -25,8 +25,7 @@ function Get-AbrVbrUnstructuredDataInfo { } process { - $ShareObjs = Get-VBRUnstructuredServer - if ($ShareObjs) { + if ($ShareObjs = Get-VBRUnstructuredServer) { Section -Style Heading3 'Unstructured Data' { Paragraph "The following table provides a summary about the unstructured data backed-up by Veeam Server $(((Get-VBRServerSession).Server))." Section -Style Heading4 'File Servers' { diff --git a/Src/Private/Get-AbrVbrVirtualInfrastructure.ps1 b/Src/Private/Get-AbrVbrVirtualInfrastructure.ps1 index 8390e81..22b9d85 100644 --- a/Src/Private/Get-AbrVbrVirtualInfrastructure.ps1 +++ b/Src/Private/Get-AbrVbrVirtualInfrastructure.ps1 @@ -6,7 +6,7 @@ function Get-AbrVbrVirtualInfrastructure { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.5 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -26,8 +26,7 @@ function Get-AbrVbrVirtualInfrastructure { process { try { - $VbrServer = Get-VBRServer - if ($VbrServer) { + if ($VbrServer = Get-VBRServer) { Section -Style Heading3 'Virtual Infrastructure' { Paragraph "The following sections detail the configuration about managed virtual servers backed-up by Veeam Server $(((Get-VBRServerSession).Server))." BlankLine diff --git a/Src/Public/Invoke-AsBuiltReport.Veeam.VBR.ps1 b/Src/Public/Invoke-AsBuiltReport.Veeam.VBR.ps1 index aea25c1..4047cd3 100644 --- a/Src/Public/Invoke-AsBuiltReport.Veeam.VBR.ps1 +++ b/Src/Public/Invoke-AsBuiltReport.Veeam.VBR.ps1 @@ -5,7 +5,7 @@ function Invoke-AsBuiltReport.Veeam.VBR { .DESCRIPTION Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo. .NOTES - Version: 0.8.6 + Version: 0.8.7 Author: Jonathan Colon Twitter: @jcolonfzenpr Github: rebelinux @@ -449,16 +449,14 @@ function Invoke-AsBuiltReport.Veeam.VBR { #---------------------------------------------------------------------------------------------# # Backup Restore Points Section # #---------------------------------------------------------------------------------------------# - if ($InfoLevel.Jobs.PSObject.Properties.Value -ne 0) { + if ($InfoLevel.Jobs.Restores -gt 0) { if (((Get-VBRBackup -WarningAction SilentlyContinue).count -gt 0) -or ((Get-VBRTapeJob).count -gt 0) -or ((Get-VBRSureBackupJob).count -gt 0)) { Section -Style Heading2 'Backups Summary' { Paragraph "The following section provides information about the jobs restore points in Veeam Server: $(((Get-VBRServerSession).Server))." BlankLine Get-AbrVbrBackupsRPSummary - if ($InfoLevel.Jobs.Restores -gt 0) { - Get-AbrVbrBackupJobsRP - Get-AbrVbrTapeBackupJobsRP - } + Get-AbrVbrBackupJobsRP + Get-AbrVbrTapeBackupJobsRP } } }