manifests/collectors/AI/MLDatastores.psd1

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

    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 }
                        $ResUCount = 1
                        $dProp = $1.properties
 
                        # Storage path info
                        $storageAccount = if ($dProp.accountName) { $dProp.accountName } else { 'N/A' }
                        $container = if ($dProp.containerName) { $dProp.containerName } else { if ($dProp.fileShareName) { $dProp.fileShareName } else { 'N/A' } }
                        $credType = if ($dProp.credentials -and $dProp.credentials.credentialsType) { $dProp.credentials.credentialsType } else { 'N/A' }
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'Workspace Name'
            Expression = '$ws.NAME'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$ws.RESOURCEGROUP'
        }
        @{
            Name = 'Datastore Name'
            Expression = '$1.name'
        }
        @{
            Name = 'Datastore Type'
            Expression = 'if ($dProp.datastoreType) { $dProp.datastoreType } else { ''N/A'' }'
        }
        @{
            Name = 'Storage Account'
            Expression = '$storageAccount'
        }
        @{
            Name = 'Container/Share'
            Expression = '$container'
        }
        @{
            Name = 'Is Default'
            Expression = 'if ($dProp.isDefault -eq $true) { ''Yes'' } else { ''No'' }'
        }
        @{
            Name = 'Credentials Type'
            Expression = '$credType'
        }
        @{
            Name = 'Description'
            Expression = 'if ($dProp.description) { $dProp.description } else { ''N/A'' }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = ''''''
        }
        @{
            Name = 'Tag Value'
            Expression = ''''''
        }
    )

    Export = @{
        WorksheetName = 'ML Datastores'
        TableNamePrefix = 'MLDatastoresTable_'
        Columns = @(
            'Workspace Name'
            'Subscription'
            'Resource Group'
            'Datastore Name'
            'Datastore Type'
            'Storage Account'
            'Container/Share'
            'Is Default'
            'Credentials Type'
            'Description'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

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