manifests/collectors/Management/CustomRoleDefinitions.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Management/CustomRoleDefinitions.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/RoleDefinition' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = 'role' RowSource = @{ Expression = @' foreach ($envelope in @($Resources | Where-Object { $_.TYPE -eq 'AZSC/Management/RoleDefinition' })) { @($envelope.PROPERTIES) } '@ } Preamble = @' $ResUCount = 1 # Parse actions $actions = if (Get-AZSCSafeProperty -InputObject $role -Path 'Actions') { ((Get-AZSCSafeProperty -InputObject $role -Path 'Actions') -join '; ') } else { 'None' } $notActions = if (Get-AZSCSafeProperty -InputObject $role -Path 'NotActions') { ((Get-AZSCSafeProperty -InputObject $role -Path 'NotActions') -join '; ') } else { 'None' } $dataActions = if (Get-AZSCSafeProperty -InputObject $role -Path 'DataActions') { ((Get-AZSCSafeProperty -InputObject $role -Path 'DataActions') -join '; ') } else { 'None' } $notDataActions = if (Get-AZSCSafeProperty -InputObject $role -Path 'NotDataActions') { ((Get-AZSCSafeProperty -InputObject $role -Path 'NotDataActions') -join '; ') } else { 'None' } # Parse assignable scopes $scopes = if (Get-AZSCSafeProperty -InputObject $role -Path 'AssignableScopes') { ((Get-AZSCSafeProperty -InputObject $role -Path 'AssignableScopes') -join '; ') } else { 'None' } '@ AdditionalRowLoops = @() TagLoop = $null Fields = @( @{ Name = 'ID' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''Id''' } @{ Name = 'Role Name' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''Name''' } @{ Name = 'Description' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''Description''' } @{ Name = 'Role Type' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''RoleType''' } @{ Name = 'Is Custom' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''IsCustom''' } @{ Name = 'Assignable Scopes' Expression = '$scopes' } @{ Name = 'Actions' Expression = '$actions' } @{ Name = 'Not Actions' Expression = '$notActions' } @{ Name = 'Data Actions' Expression = '$dataActions' } @{ Name = 'Not Data Actions' Expression = '$notDataActions' } @{ Name = 'Created On' Expression = 'if (Get-AZSCSafeProperty -InputObject $role -Path ''CreatedOn'') { ([datetime](Get-AZSCSafeProperty -InputObject $role -Path ''CreatedOn'')).ToString("yyyy-MM-dd HH:mm") } else { $null }' } @{ Name = 'Updated On' Expression = 'if (Get-AZSCSafeProperty -InputObject $role -Path ''UpdatedOn'') { ([datetime](Get-AZSCSafeProperty -InputObject $role -Path ''UpdatedOn'')).ToString("yyyy-MM-dd HH:mm") } else { $null }' } @{ Name = 'Created By' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''CreatedBy''' } @{ Name = 'Updated By' Expression = 'Get-AZSCSafeProperty -InputObject $role -Path ''UpdatedBy''' } @{ Name = 'Resource U' Expression = '$ResUCount' } ) Export = @{ WorksheetName = 'Custom Roles' TableNamePrefix = 'CustomRolesTable_' Columns = @( 'Role Name' 'Description' 'Role Type' 'Is Custom' 'Assignable Scopes' 'Actions' 'Not Actions' 'Data Actions' 'Not Data Actions' 'Created On' 'Updated On' 'Created By' 'Updated By' 'Resource U' ) TagColumns = @() TagColumnsBefore = $null NumberFormat = '0' ConditionalText = @() } SourceCollector = 'Modules/Public/InventoryModules/Management/CustomRoleDefinitions.ps1' } |