manifests/collectors/Management/BackupInstances.psd1

#
# GENERATED by scripts/Build-ScoutServiceCollector.ps1 from manifests/specs/service-collectors.psd1 (AB#6741).
# Authored as data -- there is no source collector script to drift from. Edit the spec and
# regenerate; do not hand-patch this file.
#
@{
    ResourceTypes = @(
        'AZSC/ARMChild/BackupInstances'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
                $data = $1.PROPERTIES
                $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId }
                $InstanceName = if([string]::IsNullOrEmpty($1.name)){$null}else{(([string]$1.name) -split '/')[-1]}
                $ProtectedResource = if([string]::IsNullOrEmpty($data.dataSourceInfo.resourceID)){$null}else{(Get-AZSCIdSegment -Id $data.dataSourceInfo.resourceID -Index 8)}
                $PolicyName = if([string]::IsNullOrEmpty($data.policyInfo.policyId)){$null}else{(Get-AZSCIdSegment -Id $data.policyInfo.policyId -Index 10)}
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$1.RESOURCEGROUP'
        }
        @{
            Name = 'Backup Vault'
            Expression = '$1.PARENTNAME'
        }
        @{
            Name = 'Instance'
            Expression = '$InstanceName'
        }
        @{
            Name = 'Friendly Name'
            Expression = '$data.friendlyName'
        }
        @{
            Name = 'Datasource Type'
            Expression = '$data.dataSourceInfo.datasourceType'
        }
        @{
            Name = 'Protected Resource'
            Expression = '$ProtectedResource'
        }
        @{
            Name = 'Protection State'
            Expression = '$data.currentProtectionState'
        }
        @{
            Name = 'Protection Status'
            Expression = '$data.protectionStatus.status'
        }
        @{
            Name = 'Policy'
            Expression = '$PolicyName'
        }
        @{
            Name = 'Provisioning State'
            Expression = '$data.provisioningState'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
    )

    Export = @{
        WorksheetName = 'Backup Instances'
        TableNamePrefix = 'BackupInstancesTable_'
        Columns = @(
            'Subscription'
            'Resource Group'
            'Backup Vault'
            'Instance'
            'Friendly Name'
            'Datasource Type'
            'Protected Resource'
            'Protection State'
            'Protection Status'
            'Policy'
            'Provisioning State'
            'Resource U'
        )
        TagColumns = @()
        NumberFormat = '0'
        ConditionalText = @()
    }
}