HtmlForgeX

API Reference

Command

New-HtmlX

Namespace HtmlForgeX.PowerShell
Outputs
System.String

Creates a new HtmlForgeX document and executes the nested DSL scriptblock.

Examples

Authored help example

Example 1


New-HtmlX -Title "Health Report" -FilePath .\report.html -Show {
    New-HtmlXSection -Title "Overview" {
        New-HtmlXText -Text "Generated: $(Get-Date)"
    }
}
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

New-HtmlX [-Content <ScriptBlock>] [-Author <string>] [-AutoRefresh <int>] [-FilePath <string>] [-Language <string>] [-Offline] [-Online] [-PassThru] [-Show] [-ThemeMode <System|Light|Dark>] [-Title <string>] [<CommonParameters>]
#

Parameters

Content ScriptBlock optionalposition: 0pipeline: false
Scriptblock that emits child DSL elements.
Author string optionalposition: namedpipeline: false
Author metadata to place in the HTML head.
AutoRefresh int optionalposition: namedpipeline: false
Auto refresh interval in seconds; set to 0 to disable.
FilePath string optionalposition: namedpipeline: false
When provided, saves the HTML to the given file path.
Language string optionalposition: namedpipeline: false
Language tag for the HTML document (e.g. en-US).
Offline SwitchParameter optionalposition: namedpipeline: false
Force offline library mode for embedded assets.
Online SwitchParameter optionalposition: namedpipeline: false
Force online library mode for external assets.
PassThru SwitchParameter optionalposition: namedpipeline: false
Return the Document instead of a string path/HTML.
Show SwitchParameter optionalposition: namedpipeline: false
Open the output file in the default browser after save.
ThemeMode ThemeMode optionalposition: namedpipeline: falsevalues: 3
Sets the theme mode for Tabler-based components. Possible values: System, Light, Dark
Possible values: System, Light, Dark
Title string optionalposition: namedpipeline: false
Document title to place in the HTML head.

Outputs

System.String