manifests/collectors/Management/ManagementGroups.psd1

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

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    RowSource = @{
        Expression = @'
foreach ($envelope in @($Resources | Where-Object { $_.TYPE -eq 'AZSC/Management/ManagementGroup' })) {
        @($envelope.PROPERTIES)
    }
'@

    }

    Preamble = @'
$ResUCount = 1
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'Management Group ID'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Management Group ID'''
        }
        @{
            Name = 'Display Name'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Display Name'''
        }
        @{
            Name = 'Display Name (Raw)'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Display Name (Raw)'''
        }
        @{
            Name = 'Full Path'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Full Path'''
        }
        @{
            Name = 'Hierarchy Depth'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Hierarchy Depth'''
        }
        @{
            Name = 'Parent Management Group'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Parent Management Group'''
        }
        @{
            Name = 'Tenant ID'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Tenant ID'''
        }
        @{
            Name = 'Direct Child MGs'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Direct Child MGs'''
        }
        @{
            Name = 'Direct Subscriptions'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Direct Subscriptions'''
        }
        @{
            Name = 'Direct Subscription Names'
            Expression = 'Get-AZSCSafeProperty -InputObject $1 -Path ''Direct Subscription Names'''
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
    )

    Export = @{
        WorksheetName = 'Management Groups'
        TableNamePrefix = 'MgmtGroupsTable_'
        Columns = @(
            'Management Group ID'
            'Display Name'
            'Display Name (Raw)'
            'Full Path'
            'Hierarchy Depth'
            'Parent Management Group'
            'Tenant ID'
            'Direct Child MGs'
            'Direct Subscriptions'
            'Direct Subscription Names'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Management/ManagementGroups.ps1'
}