Export-HtmlCommandHelp

SYNOPSIS

Custom HTML renderer for PlatyPS CommandHelp objects.

SYNTAX

__AllParameterSets

Export-HtmlCommandHelp [-OutputFolder] <string> -CommandHelp <CommandHelp[]> [-Force] [-PassThru]
 [-ThemeFile <string>] [-WhatIf] [-Confirm] [<CommonParameters>]

ALIASES

None

DESCRIPTION

Export-HtmlCommandHelp is a custom renderer built on the PlatyPS v1 object model. PlatyPS ships built-in renderers for Markdown, YAML, and MAML; this command extends that pattern to emit self-contained HTML files that mirror the Get-Help layout in a browser-friendly format.

It accepts CommandHelp objects from the pipeline, following the same conventions as the built-in Export-* cmdlets. There are two common input patterns:

From live reflection — generate CommandHelp objects directly from a loaded module:

New-CommandHelp -CommandInfo (Get-Command -Module MyModule) |
    Export-HtmlCommandHelp -OutputFolder .\html

From existing Markdown — round-trip through authored Markdown files so that hand-written descriptions, examples, and notes are included in the output:

Measure-PlatyPSMarkdown -Path .\docs\*.md |
    Where-Object Filetype -match 'CommandHelp' |
    Import-MarkdownCommandHelp -Path { $_.FilePath } |
    Export-HtmlCommandHelp -OutputFolder .\html

EXAMPLES

EXAMPLE 1

$exportSplat = @{
    OutputFolder = '.\html'
    Force        = $true
}

Get-Command -Module Microsoft.PowerShell.Utility |
    Select-Object -First 5 |
    New-CommandHelp |
    Export-HtmlCommandHelp @exportSplat

EXAMPLE 2

$exportSplat = @{
    OutputFolder = '.\html'
    PassThru     = $true
}
Import-MarkdownCommandHelp -Path .\docs\MyModule\Get-Widget.md | Export-HtmlCommandHelp @exportSplat

PARAMETERS

-CommandHelp

One or more Microsoft.PowerShell.PlatyPS.Model.CommandHelp objects. Accepts pipeline input.

Type: Microsoft.PowerShell.PlatyPS.Model.CommandHelp[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Force

Overwrite existing files without prompting.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-OutputFolder

Root folder for the HTML files. A sub-folder named after the module is created automatically, mirroring the convention used by Export-MarkdownCommandHelp.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PassThru

Emit the generated FileInfo objects to the pipeline.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ThemeFile

Path to a .psd1 theme file. Any keys present in the file override the built-in defaults; missing keys keep their default values. Copy themes\Default.psd1 from the module directory to get started.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.PowerShell.PlatyPS.Model.CommandHelp[]

OUTPUTS

NOTES