Private/ModuleCatalog.ps1

<#
    The optional modules a run can include, as data: what each one reads,
    which sign-in it needs, and which PowerShell modules must be installed.
    Invoke-Raidiness -Modules and Test-RaidinessPrerequisite both read this
    table so the announcement before a sign-in and the prerequisite check can
    never disagree.
#>

# psrunner-lint allow: Add-PowerAppsAccount — named here only as the sign-in cmdlet shown to the user before the Power Platform module runs; the script that calls it carries its own documented allow
$script:RaidinessModuleCatalog = @(
    [pscustomobject]@{
        Name            = 'MsGraph'
        Key             = 'core'
        Title           = 'Microsoft Graph (core)'
        Script          = $null
        Reads           = 'users, licenses, groups, sites and usage reports, Conditional Access, Secure Score, Copilot settings and usage — everything the core checks need'
        SignIn          = 'Connect-Raidiness (interactive Microsoft Graph sign-in, read-only scopes)'
        Role            = 'Global Reader sees everything; any admin account gives a partial result'
        RequiredModules = @('Microsoft.Graph.Authentication')
    }
    [pscustomobject]@{
        Name            = 'ExchangeOnline'
        Key             = 'exchange-purview'
        Title           = 'Exchange Online & Purview'
        Script          = 'exchange-purview'
        Reads           = 'mailbox counts and audit settings, DLP policies and rules, sensitivity and retention labels, label activity, insider risk and supervisory policies'
        SignIn          = 'Connect-ExchangeOnline and Connect-IPPSSession (two interactive sign-ins)'
        Role            = 'Global Reader (Get-* cmdlets only)'
        RequiredModules = @('ExchangeOnlineManagement')
    }
    [pscustomobject]@{
        Name            = 'Teams'
        Key             = 'teams'
        Title           = 'Microsoft Teams'
        Script          = 'teams'
        Reads           = 'Teams meeting and messaging policies, app setup and permission policies'
        SignIn          = 'Connect-MicrosoftTeams (interactive)'
        Role            = 'Global Reader or Teams Reader'
        RequiredModules = @('MicrosoftTeams')
    }
    [pscustomobject]@{
        Name            = 'SharePoint'
        Key             = 'sharepoint-admin'
        Title           = 'SharePoint Online admin'
        Script          = 'sharepoint-admin'
        Reads           = 'tenant sharing settings, site inventory with sharing and label state, a sample of unique permissions'
        SignIn          = 'Connect-SPOService and Connect-PnPOnline (interactive; PnP may ask per site)'
        Role            = 'SharePoint Administrator (read cmdlets only)'
        RequiredModules = @('Microsoft.Online.SharePoint.PowerShell', 'PnP.PowerShell')
    }
    [pscustomobject]@{
        Name            = 'PowerPlatform'
        Key             = 'power-platform'
        Title           = 'Power Platform & Copilot Studio'
        Script          = 'power-platform'
        Reads           = 'environments, DLP policies for connectors, Copilot Studio agents and their sharing'
        SignIn          = 'Add-PowerAppsAccount (interactive)'
        Role            = 'Power Platform Administrator or Global Reader'
        RequiredModules = @('Microsoft.PowerApps.Administration.PowerShell')
    }
)

function Get-RaidinessModuleCatalog {
    <# The catalog above, resolved for a -Modules selection. #>
    param([string[]] $Modules)
    if (-not $Modules -or $Modules -contains 'All') { return $script:RaidinessModuleCatalog }
    $unknown = @($Modules | Where-Object { $_ -notin $script:RaidinessModuleCatalog.Name })
    if ($unknown.Count -gt 0) {
        throw "Unknown module(s): $($unknown -join ', '). Choose from All, $($script:RaidinessModuleCatalog.Name -join ', ')."
    }
    return @($script:RaidinessModuleCatalog | Where-Object { $_.Name -in $Modules })
}