manifests/collectors/Identity/NamedLocations.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Identity/NamedLocations.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 = @(
        'entra/namedlocations'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
            $data = $1.properties
 
            # Determine location type from @odata.type
            $locationType = 'Unknown'
            $ipRanges = ''
            $countries = ''
            $isTrusted = $false
            if ($data.'@odata.type' -eq '#microsoft.graph.ipNamedLocation') {
                $locationType = 'IP Range'
                $isTrusted = [bool]$data.isTrusted
                if ($data.ipRanges) {
                    $ipRanges = ($data.ipRanges | ForEach-Object { $_.cidrAddress }) -join ', '
                }
            }
            elseif ($data.'@odata.type' -eq '#microsoft.graph.countryNamedLocation') {
                $locationType = 'Country'
                if ($data.countriesAndRegions) {
                    $countries = ($data.countriesAndRegions -join ', ')
                }
            }
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Tenant ID'
            Expression = '$1.tenantId'
        }
        @{
            Name = 'Display Name'
            Expression = '$data.displayName'
        }
        @{
            Name = 'Location Type'
            Expression = '$locationType'
        }
        @{
            Name = 'Is Trusted'
            Expression = '$isTrusted'
        }
        @{
            Name = 'IP Ranges'
            Expression = '$ipRanges'
        }
        @{
            Name = 'Countries'
            Expression = '$countries'
        }
        @{
            Name = 'Created DateTime'
            Expression = '$data.createdDateTime'
        }
        @{
            Name = 'Modified DateTime'
            Expression = '$data.modifiedDateTime'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
    )

    Export = @{
        WorksheetName = 'Named Locations'
        TableNamePrefix = 'NamedLocsTable_'
        Columns = @(
            'Display Name'
            'Location Type'
            'Is Trusted'
            'IP Ranges'
            'Countries'
            'Created DateTime'
            'Modified DateTime'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @()
    }

    SourceCollector = 'Modules/Public/InventoryModules/Identity/NamedLocations.ps1'
}