manifests/collectors/Monitor/AppInsightsContinuousExport.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Monitor/AppInsightsContinuousExport.ps1 (AB#5660).
# Field expressions are copied verbatim from the original collector and evaluate in an
# equivalent scope -- see docs/design/decisions/declarative-collectors.md.
# Review before trusting; regenerate rather than hand-patch if the source collector changes.
#
@{
    ResourceTypes = @(
        'AZSC/ARMChild/AppInsightsContinuousExport'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ai = $Resources | Where-Object { $_.id -eq $1.PARENTID } | Select-Object -First 1
                        $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId }
                        $ResUCount = 1
                        $destStorageId = if ($1.DestinationStorageSubscriptionId) { $1.DestinationStorageSubscriptionId } else { 'N/A' }
                        $recordTypes = if ($1.RecordTypes) { $1.RecordTypes -join ', ' } else { 'N/A' }
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'App Insights Name'
            Expression = '$ai.NAME'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$ai.RESOURCEGROUP'
        }
        @{
            Name = 'Export ID'
            Expression = 'if ($1.ExportId) { $1.ExportId } else { ''N/A'' }'
        }
        @{
            Name = 'Is Enabled'
            Expression = 'if ($1.IsUserEnabled) { ''Yes'' } else { ''No'' }'
        }
        @{
            Name = 'Destination Storage Sub'
            Expression = '$destStorageId'
        }
        @{
            Name = 'Destination Storage Location'
            Expression = 'if ($1.DestinationStorageLocationId) { $1.DestinationStorageLocationId } else { ''N/A'' }'
        }
        @{
            Name = 'Destination Account'
            Expression = 'if ($1.DestinationAccountId) { $1.DestinationAccountId } else { ''N/A'' }'
        }
        @{
            Name = 'Destination Container'
            Expression = 'if ($1.DestinationContainerId) { $1.DestinationContainerId } else { ''N/A'' }'
        }
        @{
            Name = 'Record Types'
            Expression = '$recordTypes'
        }
        @{
            Name = 'Export Status'
            Expression = 'if ($1.ExportStatus) { $1.ExportStatus } else { ''N/A'' }'
        }
        @{
            Name = 'Last Success Time'
            Expression = 'if ($1.LastSuccessTime) { $1.LastSuccessTime } else { ''N/A'' }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = ''''''
        }
        @{
            Name = 'Tag Value'
            Expression = ''''''
        }
    )

    Export = @{
        WorksheetName = 'App Insights Continuous Export'
        TableNamePrefix = 'AIContinuousExportTable_'
        Columns = @(
            'App Insights Name'
            'Subscription'
            'Resource Group'
            'Export ID'
            'Is Enabled'
            'Destination Storage Location'
            'Destination Account'
            'Destination Container'
            'Record Types'
            'Export Status'
            'Last Success Time'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Monitor/AppInsightsContinuousExport.ps1'
}