public/cbb/Get-MBSBackupPlan.ps1

function Get-MBSBackupPlan {
    <#
    .SYNOPSIS
        Get backup plans from MBS backup agent.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType All -PlanType All
        Lists all backup plans
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType Local -PlanType All
        Lists only backup plans with a local destination.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType Cloud -PlanType All
        Lists only backup plans with a cloud destination.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType All -PlanType File-Level
        Lists all File-level backup plans.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType All -PlanType Image-Based
        Lists all Image-Based backup plans.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType Local -PlanType Image-Based
        Lists Image-Based backup plans with a local destination.
    .EXAMPLE
        PS C:\> Get-MBSBackupPlan -StorageType All -PlanType All -OutputType Full
        Get extended parameters of all backup plans.
    .INPUTS
        None
    .OUTPUTS
        System.Management.Automation.PSCustomObject
    .NOTES
        Author: Alex Volkov
    .LINK
        https://kb.msp360.com/managed-backup-service/powershell-module/cmdlets/get-mbsbackupplan
    #>

    [CmdletBinding()]
    param (
        #
        [Parameter(Mandatory=$false, HelpMessage="Backup destination storage type.")]
        [ValidateSet("All", "Local", "Cloud", "Hybrid")]
        [string]
        $StorageType = "All",
        #
        [Parameter(Mandatory=$false, HelpMessage="Backup plan type.")]
        [ValidateSet("All", "File-Level", "Image-Based", "MSSQL","MSExchange","VMware","Hyper-V")]
        [string]
        $PlanType = "All",
        #
        [Parameter(Mandatory=$false, HelpMessage="Backup plan type.")]
        [ValidateSet("Short", "Full", "Raw")]
        [string]
        $OutputType = "Short"
    )

    begin {
        if (-not($CBB = Get-MBSAgent)) {
            Break
        }
    }

    process {
    function Compare-StorageTypes {
        param (
            $Account,
            [string]$StorageType
        )

        $result = $false
        switch -exact ($StorageType) {
            "All" {$result = $true}
            "Cloud" { 
                if($Account.SGCloudTypeValue -ne "FileSystemConnection" -and $Account.SGCloudTypeValue -ne "PhysicalFile" -and $BackupPlan.BasePlan.HybridID -eq "00000000-0000-0000-0000-000000000000"){
                    $result = $true 
                }else {
                    $result = $false
                }
            }
            "Local" {
                if($Account.Type -eq "FileSystemConnection" -or $Account.SGCloudTypeValue -eq "PhysicalFile"){
                    $result = $true 
                }else {
                    $result = $false
                }
            }
            "Hybrid" {
                if ($BackupPlan.BasePlan.HybridID -ne "00000000-0000-0000-0000-000000000000") {
                    $result = $true 
                }else {
                    $result = $false
                }
            }
            Default {}
        }
        return $result
    }

        Write-Verbose -Message "$($PSCmdlet.MyInvocation.MyCommand.Name): Arguments: -StorageType $StorageType -PlanType $PlanType"
        $BackupPlansArray = @()
        foreach ($_ in (Get-ChildItem ("$($CBB.CBBProgramData)\*.cbb")  -ErrorAction SilentlyContinue)){ 
            if (Get-Content $_.FullName){
                $BackupPlan = [xml](Get-Content ($_.FullName))
                switch ($PlanType) {
                    "All" 
                    { 
                        if ($BackupPlan.BasePlan.type -notlike "*Restore*" -and $BackupPlan.BasePlan.type -ne "ConsistencyCheckPlan"){
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                            }
                        }
                    }
                    "File-Level" 
                    { 
                        if ($BackupPlan.BasePlan.type -eq "Plan"){
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                if ($BackupPlan.BasePlan.IsArchive -eq "true") {
                                    $BackupPlanNBFConverted = Convert-XMLtoPSObject $BackupPlan.BasePlan
                                    $BackupPlansArray += New-Object -TypeName MBS.Agent.Plan.NBFFileLevelBackupPlan -Property @{
                                        Name = $BackupPlanNBFConverted.Name
                                        ID = $BackupPlanNBFConverted.ID
                                        StorageAccount = Get-MBSStorageAccount -ID $BackupPlanNBFConverted.ConnectionID
                                        BackupPlanCommonOption = New-Object -TypeName MBS.Agent.Plan.NBFBackupPlanCommonOption -Property @{
                                            SyncRepositoryBeforeRun = $BackupPlanNBFConverted.SyncBeforeRun
                                            UseServerSideEncryption = $BackupPlanNBFConverted.UseServerSideEncryption
                                            EncryptionAlgorithm = ($BackupPlanNBFConverted.EncryptionAlgorithm+$BackupPlanNBFConverted.EncryptionKeySize)
                                            EncryptionPassword = $(if($BackupPlanNBFConverted.UseEncryption){ConvertTo-SecureString -string "!<encrypted_string>!" -AsPlainText -Force}else{$null})
                                            UseCompression = $BackupPlanNBFConverted.UseCompression
                                            StorageClass = $BackupPlanNBFConverted.StorageClass
                                            FullConsistencyCheck = $BackupPlanNBFConverted.UseFullConsistencyCheck
                                            StopIfPlanRunsFor = $(if($BackupPlanNBFConverted.Schedule.StopAfterTicks -eq "9223372036854775807"){[timespan]"00:00:00"}else{[timespan]$BackupPlanNBFConverted.Schedule.StopAfterTicks})
                                            RunMissedPlanImmediately = $BackupPlanNBFConverted.ForceMissedSchedule
                                            PreActionCommand = $(if($BackupPlanNBFConverted.Actions.Pre.Enabled){$BackupPlanNBFConverted.Actions.Pre.CommandLine + " " + $BackupPlanNBFConverted.Actions.Pre.Arguments})
                                            PreActionContinueAnyway = $(if($BackupPlanNBFConverted.Actions.Pre.Enabled){-not $BackupPlanNBFConverted.Actions.Pre.TerminateOnFailure})
                                            PostActionCommand = $(if($BackupPlanNBFConverted.Actions.Post.Enabled){$BackupPlanNBFConverted.Actions.Post.CommandLine + " " + $BackupPlanNBFConverted.Actions.Post.Arguments})
                                            PostActionRunAnyway = $(if($BackupPlanNBFConverted.Actions.Post.Enabled){$BackupPlanNBFConverted.Actions.Post.RunOnBackupFailure})
                                            ResultEmailNotification = $(if($BackupPlanNBFConverted.Notification.SendNotification -and $BackupPlanNBFConverted.Notification.OnlyOnFailure){
                                                [MBS.Agent.Plan.Notification]"errorOnly"
                                            }elseif ($BackupPlanNBFConverted.Notification.SendNotification -and -not $BackupPlanNBFConverted.Notification.OnlyOnFailure) {
                                                [MBS.Agent.Plan.Notification]"on"
                                            }elseif (-not $BackupPlanNBFConverted.Notification.SendNotification) {
                                                [MBS.Agent.Plan.Notification]"off"
                                            })
                                            AddEventToWindowsLog = $(if($BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification -and $BackupPlanNBFConverted.WindowsEventLogNotification.OnlyOnFailure){
                                                [MBS.Agent.Plan.Notification]"errorOnly"
                                            }elseif ($BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification -and -not $BackupPlanNBFConverted.WindowsEventLogNotification.OnlyOnFailure) {
                                                [MBS.Agent.Plan.Notification]"on"
                                            }elseif (-not $BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification) {
                                                [MBS.Agent.Plan.Notification]"off"
                                            })
                                            KeepVersionPeriod = $(if($BackupPlanNBFConverted.SerializationSupportRetentionTime -eq "10675199.02:48:05.4775807") {
                                                $null
                                            }else{
                                                [timespan]$BackupPlanNBFConverted.SerializationSupportRetentionTime
                                            })
                                            GFSKeepWeekly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Weekly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Weekly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSKeepMonthly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Monthly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Monthly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSKeepYearly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Yearly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Yearly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSMonthOfTheYear = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Yearly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Yearly.TakeBackupFromMonth
                                            }else {
                                                0
                                            })
                                        }
                                        Schedule = $(if($BackupPlanNBFConverted.Schedule.Enabled){
                                            New-Object -TypeName MBS.Agent.Plan.NBFIncrementalSchedule -Property @{
                                                Frequency = $(if (-not (Compare-Object -ReferenceObject $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    "Daily"
                                                }else {
                                                    $BackupPlanNBFConverted.Schedule.RecurType
                                                })
                                                At = $(if (-not $BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [datetime]"$($BackupPlanNBFConverted.Schedule.Hour):$($BackupPlanNBFConverted.Schedule.Minutes)"
                                                }else{
                                                    [datetime]"1/1/0001 0:00:00"
                                                })
                                                DayOfMonth = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.Schedule.DayOfMonth
                                                }else{
                                                    $null
                                                })
                                                DayOfWeek = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Weekly" -and (Compare-Object -ReferenceObject $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek
                                                }else {
                                                    $null
                                                })
                                                WeekNumber = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.Schedule.WeekNumber
                                                }else {
                                                    $null
                                                })
                                                OccursFrom =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [timespan]"$($BackupPlanNBFConverted.Schedule.DailyFromHour):$($BackupPlanNBFConverted.Schedule.DailyFromMinutes)"
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                                OccursTo =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [timespan]"$($BackupPlanNBFConverted.Schedule.DailyTillHour):$($BackupPlanNBFConverted.Schedule.DailyTillMinutes)"
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                                OccursEvery =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    New-TimeSpan -Minutes $BackupPlanNBFConverted.Schedule.DailyRecurrencePeriod
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                            }
                                        }else {
                                            $null
                                        })
                                        ForceFullSchedule = $(if($BackupPlanNBFConverted.ForceFullSchedule.Enabled){
                                            New-Object -TypeName MBS.Agent.Plan.NBFFullSchedule -Property @{
                                                Frequency = $(if (-not (Compare-Object -ReferenceObject $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    "Daily"
                                                }else {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.RecurType
                                                })
                                                DayOfMonth = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.DayOfMonth
                                                }else{
                                                    $null
                                                })
                                                DayOfWeek = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Weekly" -and (Compare-Object -ReferenceObject $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek
                                                }elseif($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.DayOfWeek
                                                }else{
                                                    $null
                                                })
                                                WeekNumber = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.WeekNumber
                                                }else {
                                                    $null
                                                })
                                            }
                                        }else {
                                            $null
                                        })
                                        BackupNTFSPermissions = $BackupPlanNBFConverted.BackupNTFSPermissions
                                        FastNTFSScan = $BackupPlanNBFConverted.UseFastNtfsScan
                                        ForceUsingVSS = $BackupPlanNBFConverted.AlwaysUseVSS
                                        UseShareReadWriteModeOnError = $BackupPlanNBFConverted.UseShareReadWriteModeOnError
                                        BackupEmptyFolders = $BackupPlanNBFConverted.BackupEmptyFolders
                                        BackupOnlyAfter = [datetime]$BackupPlanNBFConverted.BackupOnlyAfterUTC
                                        ExcludeSystemHiddenFiles = -not $BackupPlanNBFConverted.BackupFilter.IncludeSystemAndHidden
                                        SkipFolder = $BackupPlanNBFConverted.ExcludeFodlerList.string
                                        IncludeFilesMask = $(if ($BackupPlanNBFConverted.BackupFilter.FilterType -eq "UseIncludeMask") {
                                            $BackupPlanNBFConverted.BackupFilter.Filters.string
                                        }else {
                                            $null
                                        })
                                        ExcludeFilesMask = $(if ($BackupPlanNBFConverted.BackupFilter.FilterType -eq "UseExcludeMask") {
                                            $BackupPlanNBFConverted.BackupFilter.Filters.string
                                        }else {
                                            $null
                                        })
                                        IgnoreErrorPathNotFound = $BackupPlanNBFConverted.UseIgnoreErrorsOnPathNotFound
                                        BackupItem = $BackupPlanNBFConverted.Items.PlanItem.Path 
                                        ExcludeItem = $BackupPlanNBFConverted.ExcludedItems.PlanItem.Path 
                                        
                                        #| ForEach-Object -Begin {$BackupFileArray = @()} -Process {
                                        # if(([IO.FileInfo]$_).Extension -ne ""){
                                        # $BackupFileArray += $_
                                        # }
                                        #} -End {if($BackupFileArray){$BackupFileArray}else{$null}})
                                        #BackupDirectory = $($BackupPlanNBFConverted.Items.PlanItem.Path | ForEach-Object -Begin {$BackupDirectoryArray = @()} -Process {
                                        # if(([IO.FileInfo]$_).Extension -eq ""){
                                        # $BackupDirectoryArray += $_
                                        # }
                                        #} -End {if($BackupDirectoryArray){$BackupDirectoryArray}else{$null}})
                                        
                                        GenerateDetailedReport = $BackupPlanNBFConverted.Notification.GenerateReport
                                    }
                                }else{
                                    $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                                }
                            }
                        }
                    }
                    "Image-Based" 
                    {
                        if ($BackupPlan.BasePlan.type -eq "BackupDiskImagePlan") {
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                if ($BackupPlan.BasePlan.IsArchive -eq "true") {
                                    $BackupPlanNBFConverted = Convert-XMLtoPSObject $BackupPlan.BasePlan
                                    $BackupPlansArray += New-Object -TypeName MBS.Agent.Plan.NBFImageBasedBackupPlan -Property @{
                                        Name = $BackupPlanNBFConverted.Name
                                        ID = $BackupPlanNBFConverted.ID
                                        StorageAccount = Get-MBSStorageAccount -ID $BackupPlanNBFConverted.ConnectionID
                                        BackupPlanCommonOption = New-Object -TypeName MBS.Agent.Plan.NBFBackupPlanCommonOption -Property @{
                                            SyncRepositoryBeforeRun = $BackupPlanNBFConverted.SyncBeforeRun
                                            UseServerSideEncryption = $BackupPlanNBFConverted.UseServerSideEncryption
                                            EncryptionAlgorithm = ($BackupPlanNBFConverted.EncryptionAlgorithm+$BackupPlanNBFConverted.EncryptionKeySize)
                                            EncryptionPassword = $(if($BackupPlanNBFConverted.UseEncryption){ConvertTo-SecureString -string "!<encrypted_string>!" -AsPlainText -Force}else{$null})
                                            UseCompression = $BackupPlanNBFConverted.UseCompression
                                            StorageClass = $BackupPlanNBFConverted.StorageClass
                                            FullConsistencyCheck = $BackupPlanNBFConverted.UseFullConsistencyCheck
                                            StopIfPlanRunsFor = $(if($BackupPlanNBFConverted.Schedule.StopAfterTicks -eq "9223372036854775807"){[timespan]"00:00:00"}else{[timespan]$BackupPlanNBFConverted.Schedule.StopAfterTicks})
                                            RunMissedPlanImmediately = $BackupPlanNBFConverted.ForceMissedSchedule
                                            PreActionCommand = $(if($BackupPlanNBFConverted.Actions.Pre.Enabled){$BackupPlanNBFConverted.Actions.Pre.CommandLine + " " + $BackupPlanNBFConverted.Actions.Pre.Arguments})
                                            PreActionContinueAnyway = $(if($BackupPlanNBFConverted.Actions.Pre.Enabled){-not $BackupPlanNBFConverted.Actions.Pre.TerminateOnFailure})
                                            PostActionCommand = $(if($BackupPlanNBFConverted.Actions.Post.Enabled){$BackupPlanNBFConverted.Actions.Post.CommandLine + " " + $BackupPlanNBFConverted.Actions.Post.Arguments})
                                            PostActionRunAnyway = $(if($BackupPlanNBFConverted.Actions.Post.Enabled){$BackupPlanNBFConverted.Actions.Post.RunOnBackupFailure})
                                            ResultEmailNotification = $(if($BackupPlanNBFConverted.Notification.SendNotification -and $BackupPlanNBFConverted.Notification.OnlyOnFailure){
                                                [MBS.Agent.Plan.Notification]"errorOnly"
                                            }elseif ($BackupPlanNBFConverted.Notification.SendNotification -and -not $BackupPlanNBFConverted.Notification.OnlyOnFailure) {
                                                [MBS.Agent.Plan.Notification]"on"
                                            }elseif (-not $BackupPlanNBFConverted.Notification.SendNotification) {
                                                [MBS.Agent.Plan.Notification]"off"
                                            })
                                            AddEventToWindowsLog = $(if($BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification -and $BackupPlanNBFConverted.WindowsEventLogNotification.OnlyOnFailure){
                                                [MBS.Agent.Plan.Notification]"errorOnly"
                                            }elseif ($BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification -and -not $BackupPlanNBFConverted.WindowsEventLogNotification.OnlyOnFailure) {
                                                [MBS.Agent.Plan.Notification]"on"
                                            }elseif (-not $BackupPlanNBFConverted.WindowsEventLogNotification.SendNotification) {
                                                [MBS.Agent.Plan.Notification]"off"
                                            })
                                            KeepVersionPeriod = $(if($BackupPlanNBFConverted.SerializationSupportRetentionTime -eq "10675199.02:48:05.4775807") {
                                                $null
                                            }else{
                                                [timespan]$BackupPlanNBFConverted.SerializationSupportRetentionTime
                                            })
                                            GFSKeepWeekly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Weekly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Weekly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSKeepMonthly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Monthly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Monthly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSKeepYearly = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Yearly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Yearly.StorePeriod
                                            }else {
                                                $null
                                            })
                                            GFSMonthOfTheYear = $(if($BackupPlanNBFConverted.GFSPolicySettings.IsEnabled -and $BackupPlanNBFConverted.GFSPolicySettings.Yearly.IsEnabled){
                                                $BackupPlanNBFConverted.GFSPolicySettings.Yearly.TakeBackupFromMonth
                                            }else {
                                                0
                                            })
                                        }
                                        Schedule = $(if($BackupPlanNBFConverted.Schedule.Enabled){
                                            New-Object -TypeName MBS.Agent.Plan.NBFIncrementalSchedule -Property @{
                                                Frequency = $(if (-not (Compare-Object -ReferenceObject $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    "Daily"
                                                }else {
                                                    $BackupPlanNBFConverted.Schedule.RecurType
                                                })
                                                At = $(if (-not $BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [datetime]"$($BackupPlanNBFConverted.Schedule.Hour):$($BackupPlanNBFConverted.Schedule.Minutes)"
                                                }else{
                                                    [datetime]"1/1/0001 0:00:00"
                                                })
                                                DayOfMonth = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.Schedule.DayOfMonth
                                                }else{
                                                    $null
                                                })
                                                DayOfWeek = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Weekly" -and (Compare-Object -ReferenceObject $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    $BackupPlanNBFConverted.Schedule.WeekDays.DayOfWeek
                                                }else {
                                                    $null
                                                })
                                                WeekNumber = $(if ($BackupPlanNBFConverted.Schedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.Schedule.WeekNumber
                                                }else {
                                                    $null
                                                })
                                                OccursFrom =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [timespan]"$($BackupPlanNBFConverted.Schedule.DailyFromHour):$($BackupPlanNBFConverted.Schedule.DailyFromMinutes)"
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                                OccursTo =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    [timespan]"$($BackupPlanNBFConverted.Schedule.DailyTillHour):$($BackupPlanNBFConverted.Schedule.DailyTillMinutes)"
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                                OccursEvery =  $(if ($BackupPlanNBFConverted.Schedule.DailyRecurrence) {
                                                    New-TimeSpan -Minutes $BackupPlanNBFConverted.Schedule.DailyRecurrencePeriod
                                                }else{
                                                    [timespan]"00:00:00"
                                                })
                                            }
                                        }else {
                                            $null
                                        })
                                        ForceFullSchedule = $(if($BackupPlanNBFConverted.ForceFullSchedule.Enabled){
                                            New-Object -TypeName MBS.Agent.Plan.NBFFullSchedule -Property @{
                                                Frequency = $(if (-not (Compare-Object -ReferenceObject $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    "Daily"
                                                }else {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.RecurType
                                                })
                                                DayOfMonth = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.DayOfMonth
                                                }else{
                                                    $null
                                                })
                                                DayOfWeek = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Weekly" -and (Compare-Object -ReferenceObject $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek -DifferenceObject @("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"))) {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.WeekDays.DayOfWeek
                                                }elseif($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.DayOfWeek
                                                }else{
                                                    $null
                                                })
                                                WeekNumber = $(if ($BackupPlanNBFConverted.ForceFullSchedule.RecurType -eq "Monthly") {
                                                    $BackupPlanNBFConverted.ForceFullSchedule.WeekNumber
                                                }else {
                                                    $null
                                                })
                                            }
                                        }else {
                                            $null
                                        })
                                        BackupVolumes = $(switch ($BackupPlanNBFConverted.BackupVolumes) {
                                            "AllDrives" {[MBS.Agent.Plan.BackupVolumeType]"AllVolumes"}
                                            "SystemRequired" { [MBS.Agent.Plan.BackupVolumeType]"SystemRequired" }
                                            "SelectedOnly" { [MBS.Agent.Plan.BackupVolumeType]"SelectedVolumes" }
                                            Default {  }
                                        })
                                        Volumes = $(if ($BackupPlanNBFConverted.BackupVolumes -eq "SelectedOnly") {
                                            $BackupPlanNBFConverted.DiskInfo.DiskInfoCommunication.Volumes.VolumeInfoCommunication | Where-Object Enabled -eq $true | ForEach-Object -Begin {$BackupVolumeArray = [System.Collections.Generic.List[MBS.Agent.IBBVolume]]::new()} -Process{
                                                $BackupVolumeArray += New-Object -TypeName MBS.Agent.IBBVolume -Property @{
                                                    MountPoints = $_.MountPoints.string
                                                    Supported = $_.Supported
                                                    RequiredBySystem = $_.RequiredBySystem
                                                    DriveType = $_.DriveType
                                                    FileSystemType = $_.FileSystemType
                                                    WindowsVolumeIdentity = $_.WindowsVolumeIdentity
                                                    Length = $_.Length
                                                    UsedSpace = $_.UsedSpace
                                                    Label = $_.Label
                                                    IsBoot = $_.IsBoot
                                                    IsActive = $_.BiosIsActive
                                                }
                                            } -End {if($BackupVolumeArray){$BackupVolumeArray}else{}}
                                        }else {
                                            $null
                                        })
                                        DisableVSS = $BackupPlanNBFConverted.DisableVSS
                                        IgnoreBadSectors = $BackupPlanNBFConverted.IgnoreBadSectors
                                        UseSystemVSS = $(if ($BackupPlanNBFConverted.VSSProviderID -eq "b5946137-7b9f-4925-af80-51abd60b20d5") {
                                            $true
                                        }else {
                                            $false
                                        })
                                        PrefetchBlockCount = $BackupPlanNBFConverted.PrefetchBlockCount
                                        BlockSize = $BackupPlanNBFConverted.BlockSize / 1024
                                        RestoreVerificationMode = $(switch ($BackupPlanNBFConverted.RunRestoreVerificationOn) {
                                            "None" { [MBS.Agent.Plan.RestoreVerificationMode]"DoNotRun" }
                                            "OnFull" { [MBS.Agent.Plan.RestoreVerificationMode]"RunForFull" }
                                            "OnDiff" { [MBS.Agent.Plan.RestoreVerificationMode]"RunForIncremental" }
                                            "OnAll" { [MBS.Agent.Plan.RestoreVerificationMode]"RunForFullAndIncremental" }
                                            Default {}
                                        })
                                    }
                                }else{
                                    $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                                }
                            }
                        }
                    }
                    "MSSQL" 
                    {
                        if ($BackupPlan.BasePlan.type -eq "BackupDatabasePlan") {
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                            }
                        }
                    }
                    "MSExchange" 
                    {
                        if ($BackupPlan.BasePlan.type -eq "BackupExchangePlan") {
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                            }
                        }
                    }
                    "VMware" 
                    {
                        if ($BackupPlan.BasePlan.type -eq "BackupVirtualMachinesESXiPlan") {
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                            }
                        }
                    }
                    "Hyper-V" 
                    {
                        if ($BackupPlan.BasePlan.type -eq "BackupVirtualMachinesHyperVPlan") {
                            if(Compare-StorageTypes -Account (Get-MBSStorageAccount -ID $BackupPlan.BasePlan.ConnectionID) -StorageType $StorageType){
                                $BackupPlansArray += Convert-XMLtoPSObject $BackupPlan.BasePlan
                            }
                        }
                    }
                    Default {Write-Error -message "Incorrect PlanType parameter"}
                }
            }
        }
        switch ($OutputType) {
            "Short" {
                $BackupPlansArray = $BackupPlansArray | Select-Object ID, Name, Type, Bucket, ConnectionID, UseEncryption, UseCompression, Items, ExcludedItems, DiskInfo, Schedule, ForceFullSchedule
            }
            "Full" {
                $BackupPlansArray = $BackupPlansArray | Select-Object -Property * -ExcludeProperty xsd, xsi, Tag
            }
            "Raw" {
                $BackupPlansArray = $BackupPlansArray | Select-Object *
            }
            Default {Write-Error -message "Incorrect OutputType parameter"}
        }
        return $BackupPlansArray
    }

    end{

    }
}

# SIG # Begin signature block
# MIIbfAYJKoZIhvcNAQcCoIIbbTCCG2kCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBWhX5JvfJN39UV
# 75Nwtri66QE4Z78fq/gQ5ydyxPP0iaCCC04wggVmMIIETqADAgECAhEA3VtfmfWb
# K32tKkM2xJo7CjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJHQjEbMBkGA1UE
# CBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQK
# ExFDT01PRE8gQ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