manifests/collectors/AI/MLDatasets.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/AI/MLDatasets.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/MLDatasets'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ws = $Resources | Where-Object { $_.id -eq $1.PARENTID } | Select-Object -First 1
                        $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId }
                        $vData = $1.AZSC.LatestVersion
                        $latestVersion = if ($vData) { $vData.name } else { 'N/A' }
                        $dataType = if ($vData.properties.dataType) { $vData.properties.dataType } else { 'N/A' }
                        $dataPath = if ($vData.properties.dataUri) { $vData.properties.dataUri } else { 'N/A' }
                        $createdTime = if ($vData.systemData.createdAt) { ([datetime]$vData.systemData.createdAt).ToString('yyyy-MM-dd') } else { 'N/A' }
 
                        $ResUCount = 1
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'Workspace Name'
            Expression = '$ws.NAME'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$ws.RESOURCEGROUP'
        }
        @{
            Name = 'Dataset Name'
            Expression = '$1.name'
        }
        @{
            Name = 'Dataset Type'
            Expression = '$dataType'
        }
        @{
            Name = 'Latest Version'
            Expression = '$latestVersion'
        }
        @{
            Name = 'Data Path'
            Expression = '$dataPath'
        }
        @{
            Name = 'Created Date'
            Expression = '$createdTime'
        }
        @{
            Name = 'Description'
            Expression = 'if ($1.properties.description) { $1.properties.description } else { ''N/A'' }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = ''''''
        }
        @{
            Name = 'Tag Value'
            Expression = ''''''
        }
    )

    Export = @{
        WorksheetName = 'ML Datasets'
        TableNamePrefix = 'MLDatasetsTable_'
        Columns = @(
            'Workspace Name'
            'Subscription'
            'Resource Group'
            'Dataset Name'
            'Dataset Type'
            'Latest Version'
            'Data Path'
            'Created Date'
            'Description'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/AI/MLDatasets.ps1'
}