manifests/collectors/Compute/AVDScalingPlans.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Compute/AVDScalingPlans.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 = @(
        'microsoft.desktopvirtualization/scalingplans'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
            $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId }
            $data = $1.PROPERTIES
            $Tags = if (![string]::IsNullOrEmpty($1.tags.psobject.properties)) { $1.tags.psobject.properties } else { '0' }
 
            $scheduleCount = if ($data.schedules) { @($data.schedules).Count } else { 0 }
            $hpRefCount = if ($data.hostPoolReferences) { @($data.hostPoolReferences).Count } else { 0 }
            $hpNames = if ($data.hostPoolReferences) {
                (@($data.hostPoolReferences) | ForEach-Object {
                    if ($_.hostPoolArmPath) { ($_.hostPoolArmPath -split '/')[-1] } else { 'N/A' }
                }) -join '; '
            } else { 'None' }
 
            # Flatten schedule details into one row per plan (summary)
            $scheduleNames = if ($data.schedules) {
                (@($data.schedules) | ForEach-Object { $_.name }) -join '; '
            } else { 'None' }
'@


    AdditionalRowLoops = @()

    TagLoop = @{
        Variable = 'Tag'
        Source = '$Tags'
        Preamble = ''
    }

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$1.RESOURCEGROUP'
        }
        @{
            Name = 'Name'
            Expression = '$1.NAME'
        }
        @{
            Name = 'Location'
            Expression = '$1.LOCATION'
        }
        @{
            Name = 'Friendly Name'
            Expression = 'if ($data.friendlyName) { $data.friendlyName } else { ''N/A'' }'
        }
        @{
            Name = 'Description'
            Expression = 'if ($data.description) { $data.description } else { ''N/A'' }'
        }
        @{
            Name = 'Host Pool Type'
            Expression = 'if ($data.hostPoolType) { $data.hostPoolType } else { ''N/A'' }'
        }
        @{
            Name = 'Time Zone'
            Expression = 'if ($data.timeZone) { $data.timeZone } else { ''N/A'' }'
        }
        @{
            Name = 'Exclusion Tag'
            Expression = 'if ($data.exclusionTag) { $data.exclusionTag } else { ''None'' }'
        }
        @{
            Name = 'Schedules Count'
            Expression = '$scheduleCount'
        }
        @{
            Name = 'Schedule Names'
            Expression = '$scheduleNames'
        }
        @{
            Name = 'Host Pool References Count'
            Expression = '$hpRefCount'
        }
        @{
            Name = 'Host Pools'
            Expression = '$hpNames'
        }
        @{
            Name = 'Provisioning State'
            Expression = 'if ($data.provisioningState) { $data.provisioningState } else { ''N/A'' }'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = '[string]$Tag.Name'
        }
        @{
            Name = 'Tag Value'
            Expression = '[string]$Tag.Value'
        }
    )

    Export = @{
        WorksheetName = 'AVD Scaling Plans'
        TableNamePrefix = 'AVDScalingPlansTable_'
        Columns = @(
            'Subscription'
            'Resource Group'
            'Name'
            'Location'
            'Friendly Name'
            'Host Pool Type'
            'Time Zone'
            'Exclusion Tag'
            'Schedules Count'
            'Schedule Names'
            'Host Pool References Count'
            'Host Pools'
            'Provisioning State'
            'Resource U'
        )
        TagColumns = @(
            'Tag Name'
            'Tag Value'
        )
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Compute/AVDScalingPlans.ps1'
}