Src/Private/Get-AbrVbrMalwareDetectionOption.ps1

function Get-AbrVbrMalwareDetectionOption {
    <#
    .SYNOPSIS
    Used by As Built Report to returns Malware Detection Option settings configured on Veeam Backup & Replication..
    .DESCRIPTION
        Documents the configuration of Veeam VBR in Word/HTML/Text formats using PScribo.
    .NOTES
        Version: 0.8.4
        Author: Jonathan Colon
        Twitter: @jcolonfzenpr
        Github: rebelinux
        Credits: Iain Brighton (@iainbrighton) - PScribo module
 
    .LINK
        https://github.com/AsBuiltReport/AsBuiltReport.Veeam.VBR
    #>

    [CmdletBinding()]
    param (

    )

    begin {
        Write-PscriboMessage "Discovering Veeam VBR Malware Detection Option settings information from $System."
    }

    process {
        try {
            $MalwareDetectionOption = Get-VBRMalwareDetectionOptions
            Section -Style Heading4 'Malware Detection' {
                $OutObj = @()
                $inObj = [ordered] @{
                    'Inline entropy analisys' = ConvertTo-TextYN $MalwareDetectionOption.InlineMalwareScanEnabled
                    'Sensitivity' = $MalwareDetectionOption.Sensitivity
                    'File system activity analisys' = ConvertTo-TextYN $MalwareDetectionOption.GuestIndexScanEnabled
                    'Update malware definition automatically' = ConvertTo-TextYN $MalwareDetectionOption.UpdateExtensionsListPeriodically
                    'File Maks: Suspicious Extensions' = $MalwareDetectionOption.SuspiciousExtensions -join ","
                    'File Maks: Non Suspicious Extensions' = $MalwareDetectionOption.NonSuspiciousExtensions -join ","
                    'Incident API: Quick Backup On External Event' = ConvertTo-TextYN $MalwareDetectionOption.QuickBackupOnExternalEventEnabled
                    'Send SNMP notification for detected malware' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.EnableSnmpNotification
                    'Send email notification for detected malware' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.EnableAdditionalNotification
                    'Aditional email address' = $MalwareDetectionOption.NotificationOptions.AdditionalAddress
                    'Use custom notification settings' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.UseNotificationOptions
                    'Notify on success' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.NotifyOnSuccess
                    'Notify on warning' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.NotifyOnWarning
                    'Notify on error' = ConvertTo-TextYN $MalwareDetectionOption.NotificationOptions.NotifyOnError
                }
                $OutObj += [pscustomobject]$inobj

                if ($HealthCheck.Infrastructure.Settings) {
                    $OutObj | Where-Object { $_.'Update malware definition automatically' -eq 'No'} | Set-Style -Style Warning -Property 'Update malware definition automatically'
                }

                $TableParams = @{
                    Name = "Malware Detection - $VeeamBackupServer"
                    List = $true
                    ColumnWidths = 40, 60
                }
                if ($Report.ShowTableCaptions) {
                    $TableParams['Caption'] = "- $($TableParams.Name)"
                }
                $OutObj | Table @TableParams
            }
        }
        catch {
            Write-PscriboMessage -IsWarning "Malware Detection Option Section: $($_.Exception.Message)"
        }
    }
    end {}

}