API Reference
RuleIntrospection
Provides developer-focused helpers for discovering TestimoX rules and generating structured metadata or paste‑ready snippets.
Inheritance
- Object
- RuleIntrospection
Remarks
This API is intended for programmatic use in examples, tests and tools (including PowerShell cmdlets). It does not affect normal CLI behavior.
Methods
BuildCSharpRuleNameMap() #Creates a lookup from rule name to enum member for C# rules.
BuildPowerShellRuleNameMap() #Creates a lookup from rule name to enum member for PowerShell rules.
public static async Task<IReadOnlyList<RuleInventoryEntry>> GetInventoryAsync(Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null, Nullable<RuleSelectionProfile> profile = null) #Task<IReadOnlyList<RuleInventoryEntry>>Discovers rules and returns a migration-oriented inventory view that highlights authoritative C#, legacy PowerShell, and superseded/hidden implementations.
Parameters
- includeDisabled System.Boolean = true
- When true, returns disabled rules as well.
- ct System.Threading.CancellationToken = null
- A cancellation token.
- powerShellRulesDirectory System.String = null
- Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
- profile System.Nullable{TestimoX.Execution.RuleSelectionProfile} = null
- Optional curated profile used to classify inventory rows into assessment areas.
Returns
Ordered list of RuleInventoryEntry entries.
public static async Task<String[]> GetNameOnlyAsync(Nullable<RuleSourceType> type = null, Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #Task<String[]>Produces name‑only values such as "CSharpRule.AdminInactive" or "PowerShellRule.DCDiskSpace" suitable for copy/paste into C# arrays. Only rules with an enum mapping are returned.
Parameters
- type System.Nullable{TestimoX.Definitions.RuleSourceType} = null
- Optional source filter. Null returns both kinds.
- includeDisabled System.Boolean = true
- When true, returns disabled rules as well.
- ct System.Threading.CancellationToken = null
- A cancellation token.
- powerShellRulesDirectory System.String = null
- Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
Returns
Alphabetically ordered qualified names.
public static async Task<IReadOnlyList<RuleOverview>> GetOverviewAsync(Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #Task<IReadOnlyList<RuleOverview>>Discovers rules via the standard providers and returns a flattened overview that includes display details, category, enablement and the corresponding enum mapping when available.
Parameters
- includeDisabled System.Boolean = true
- When true, returns rules even if disabled.
- ct System.Threading.CancellationToken = null
- A cancellation token.
- powerShellRulesDirectory System.String = null
- Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
Returns
Ordered list of RuleOverview entries.
public static async Task<String[]> GetSnippetAsync(Nullable<RuleSourceType> type = null, Int32 indentSpaces = 12, Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #Task<String[]>Builds indented lines like " CSharpRule.AdminInactive," ready to paste into a C# array initializer.
Parameters
- type TestimoX.Definitions.RuleSourceType = null
- Source type to emit (CSharp or PowerShell).
- indentSpaces System.Int32 = 12
- Number of spaces to prepend to each line.
- includeDisabled System.Boolean = true
- When true, returns disabled rules as well.
- ct System.Threading.CancellationToken = null
- A cancellation token.
- powerShellRulesDirectory System.String = null
- Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
Returns
Formatted, alphabetically sorted lines.
GetSnippetAsync(System.Nullable{TestimoX.Definitions.RuleSourceType} type, System.Int32 indentSpaces, System.Boolean includeDisabled, System.Threading.CancellationToken ct, System.String powerShellRulesDirectory) #Builds indented lines like " CSharpRule.AdminInactive," for both or a specific source type.
Parameters
- type System.Nullable{TestimoX.Definitions.RuleSourceType}
- Optional source filter. Null returns both kinds.
- indentSpaces System.Int32
- Number of spaces to prepend to each line.
- includeDisabled System.Boolean
- When true, returns disabled rules as well.
- ct System.Threading.CancellationToken
- A cancellation token.
- powerShellRulesDirectory System.String
- Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
Returns
Formatted, alphabetically sorted lines.