manifests/collectors/AI/MLComputes.psd1

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

    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
                        $cProp = $1.properties
 
                        # Cluster-specific sizes
                        $vmSize = if ($cProp.properties.vmSize) { $cProp.properties.vmSize } else { 'N/A' }
                        $minNodes = if ($null -ne $cProp.properties.scaleSettings.minNodeCount) { $cProp.properties.scaleSettings.minNodeCount } else { 'N/A' }
                        $maxNodes = if ($null -ne $cProp.properties.scaleSettings.maxNodeCount) { $cProp.properties.scaleSettings.maxNodeCount } else { 'N/A' }
                        $vmPriority = if ($cProp.properties.vmPriority) { $cProp.properties.vmPriority } 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 = 'Compute Name'
            Expression = '$1.name'
        }
        @{
            Name = 'Compute Type'
            Expression = 'if ($cProp.computeType) { $cProp.computeType } else { ''N/A'' }'
        }
        @{
            Name = 'VM Size'
            Expression = '$vmSize'
        }
        @{
            Name = 'VM Priority'
            Expression = '$vmPriority'
        }
        @{
            Name = 'Min Nodes'
            Expression = '$minNodes'
        }
        @{
            Name = 'Max Nodes'
            Expression = '$maxNodes'
        }
        @{
            Name = 'Location'
            Expression = 'if ($1.location) { $1.location } else { ''N/A'' }'
        }
        @{
            Name = 'State'
            Expression = 'if ($cProp.provisioningState) { $cProp.provisioningState } else { ''N/A'' }'
        }
        @{
            Name = 'Description'
            Expression = 'if ($cProp.description) { $cProp.description } else { ''N/A'' }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = ''''''
        }
        @{
            Name = 'Tag Value'
            Expression = ''''''
        }
    )

    Export = @{
        WorksheetName = 'ML Compute'
        TableNamePrefix = 'MLComputeTable_'
        Columns = @(
            'Workspace Name'
            'Subscription'
            'Resource Group'
            'Compute Name'
            'Compute Type'
            'VM Size'
            'VM Priority'
            'Min Nodes'
            'Max Nodes'
            'Location'
            'State'
            'Description'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

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