Public/Get-RaidinessCheck.ps1
|
function Get-RaidinessCheck { <# .SYNOPSIS Lists the checks Raidiness runs, from the bundled check catalog. .DESCRIPTION Reads assets/checks.catalog.json — the same "rules are data" catalog the report evaluates — and returns one object per check: key, topic, title, tier (T1 Graph, T2 PowerShell module, T3 delegated, T4 manual upload), module, the collectors and measurements it reads, and its why/advice text. Useful to see what a run will and will not cover before you run it, or to look up what a finding key means. .PARAMETER Key One or more check keys (wildcards allowed), e.g. SEC-01 or GOV-*. .PARAMETER Topic Filter by topic: identity, governance, tech, adoption, shadow, agents. .PARAMETER Module Filter by module, e.g. core, exchange-purview, teams. .EXAMPLE Get-RaidinessCheck | Group-Object topic | Select-Object Name, Count .EXAMPLE Get-RaidinessCheck -Key 'SEC-*' | Format-Table key, tier, title #> [CmdletBinding()] [OutputType([pscustomobject])] param( [SupportsWildcards()] [string[]] $Key, [string] $Topic, [string] $Module ) $catalogPath = Join-Path $PSScriptRoot '..' 'assets' 'checks.catalog.json' if (-not (Test-Path $catalogPath)) { throw "Check catalog not found at $catalogPath. In a source checkout, build the module assets first: bun run module:build" } $catalog = Get-Content -Path $catalogPath -Raw | ConvertFrom-Json foreach ($check in $catalog.checks) { if ($Key -and -not ($Key | Where-Object { $check.key -like $_ })) { continue } if ($Topic -and $check.topic -ne $Topic) { continue } if ($Module -and $check.module -ne $Module) { continue } [pscustomobject]@{ PSTypeName = 'Raidiness.Check' key = $check.key topic = $check.topic title = $check.title tier = $check.tier module = $check.module section = $check.section collectors = @($check.collectors) measurements = @($check.measurements) why = $check.why advice = $check.advice } } } |