TestimoX

API Reference

Class

RuleIntrospection

Namespace TestimoX.Execution
Assembly TestimoX
Modifiers static

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) #
Returns: 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 optionalposition: 0
When true, returns disabled rules as well.
ct System.Threading.CancellationToken = null optionalposition: 1
A cancellation token.
powerShellRulesDirectory System.String = null optionalposition: 2
Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.
profile System.Nullable{TestimoX.Execution.RuleSelectionProfile} = null optionalposition: 3
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) #
Returns: 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 optionalposition: 0
Optional source filter. Null returns both kinds.
includeDisabled System.Boolean = true optionalposition: 1
When true, returns disabled rules as well.
ct System.Threading.CancellationToken = null optionalposition: 2
A cancellation token.
powerShellRulesDirectory System.String = null optionalposition: 3
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) #
Returns: 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 optionalposition: 0
When true, returns rules even if disabled.
ct System.Threading.CancellationToken = null optionalposition: 1
A cancellation token.
powerShellRulesDirectory System.String = null optionalposition: 2
Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.

Returns

Ordered list of RuleOverview entries.

GetSnippetAsync 2 overloads
public static async Task<String[]> GetSnippetAsync(Nullable<RuleSourceType> type = null, Int32 indentSpaces = 12, Boolean includeDisabled = true, CancellationToken ct = null, String powerShellRulesDirectory = null) #
Returns: Task<String[]>

Builds indented lines like " CSharpRule.AdminInactive," ready to paste into a C# array initializer.

Parameters

type TestimoX.Definitions.RuleSourceType = null optionalposition: 0
Source type to emit (CSharp or PowerShell).
indentSpaces System.Int32 = 12 optionalposition: 1
Number of spaces to prepend to each line.
includeDisabled System.Boolean = true optionalposition: 2
When true, returns disabled rules as well.
ct System.Threading.CancellationToken = null optionalposition: 3
A cancellation token.
powerShellRulesDirectory System.String = null optionalposition: 4
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} required
Optional source filter. Null returns both kinds.
indentSpaces System.Int32 required
Number of spaces to prepend to each line.
includeDisabled System.Boolean required
When true, returns disabled rules as well.
ct System.Threading.CancellationToken required
A cancellation token.
powerShellRulesDirectory System.String required
Optional directory containing additional user PowerShell rules (.ps1) to load alongside built-in rules.

Returns

Formatted, alphabetically sorted lines.