manifests/collectors/Monitor/LAWorkspaceSolutions.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Monitor/LAWorkspaceSolutions.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.operationsmanagement/solutions'
    )

    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' }
 
            # Workspace ID
            $wsId = if ($data.workspaceResourceId) { $data.workspaceResourceId } else { 'N/A' }
            $wsName = if ($wsId -ne 'N/A') { ($wsId -split '/')[-1] } else { 'N/A' }
 
            # Plan info
            $planName = if ($1.PLAN) { $1.PLAN.name } else { 'N/A' }
            $planPublisher = if ($1.PLAN) { $1.PLAN.publisher } else { 'N/A' }
            $planProduct = if ($1.PLAN) { $1.PLAN.product } else { 'N/A' }
'@


    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 = 'Solution Name'
            Expression = '$1.NAME'
        }
        @{
            Name = 'Location'
            Expression = '$1.LOCATION'
        }
        @{
            Name = 'Workspace Name'
            Expression = '$wsName'
        }
        @{
            Name = 'Workspace Resource ID'
            Expression = '$wsId'
        }
        @{
            Name = 'Plan Name'
            Expression = '$planName'
        }
        @{
            Name = 'Publisher'
            Expression = '$planPublisher'
        }
        @{
            Name = 'Product'
            Expression = '$planProduct'
        }
        @{
            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 = 'LA Solutions'
        TableNamePrefix = 'LASolutionsTable_'
        Columns = @(
            'Subscription'
            'Resource Group'
            'Solution Name'
            'Location'
            'Workspace Name'
            'Plan Name'
            'Publisher'
            'Product'
            'Provisioning State'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Monitor/LAWorkspaceSolutions.ps1'
}