TestimoX

API Reference

Class

PowerShellRuleParser

Namespace TestimoX.RulesPowerShell
Assembly TestimoX

Class to parse PowerShell rules read from files or embedded resources (PS1 files)

Inheritance

  • Object
  • PowerShellRuleParser

Constructors

public PowerShellRuleParser() #

Methods

public static Rule ParseRule(String filePath) #
Returns: Rule

Parse a PowerShell rule file and return a Rule object

Parameters

filePath System.String requiredposition: 0
public static async Task<Rule> ParseRuleAsync(String filePath) #
Returns: Task<Rule>

Parse a PowerShell rule file and return a Rule object.

Parameters

filePath System.String requiredposition: 0
public static Rule ParseRuleFromContent(String scriptContent, String fileName) #
Returns: Rule

Parse a PowerShell script content and return a Rule object. Uses the PowerShell engine for fidelity; falls back to AST-only parsing when necessary.

Parameters

scriptContent System.String requiredposition: 0
fileName System.String requiredposition: 1
public static Task<Rule> ParseRuleFromContentAsync(String scriptContent, String fileName) #
Returns: Task<Rule>

Parse a PowerShell script content and return a Rule object. Uses the PowerShell engine for fidelity; falls back to AST-only parsing when necessary.

Parameters

scriptContent System.String requiredposition: 0
fileName System.String requiredposition: 1