Skip to content

Add-DiaHtmlLabel

SYNOPSIS

Converts a string to an HTML table for the report main logo and title.

SYNTAX

Text Only
Add-DiaHTMLLabel [-Label] <string> [[-ImagesObj] <hashtable>] [[-IconType] <string>]
 [[-IconPath] <FileInfo>] [[-IconHeight] <int>] [[-IconWidth] <int>] [[-IconDebug] <bool>]
 [[-Fontsize] <int>] [[-fontColor] <string>] [[-fontName] <string>] [[-CellPadding] <int>]
 [[-CellSpacing] <int>] [[-SubgraphCellPadding] <int>] [[-SubgraphCellSpacing] <int>]
 [[-ImageSizePercent] <int>] [[-TableBorder] <int>] [-SubgraphLabel] [<CommonParameters>]

DESCRIPTION

This function takes a string and converts it into an HTML table format used for the report's main logo and title. It supports customization of the logo, font, and debug options.

EXAMPLES

EXAMPLE 1

PowerShell
$script:Images = @{
    "Main_Logo" = "Diagrammer.png"
    "Server" = "Server.png"
}

$CustomLogo = "Logo Path"
$IconDebug = $false
$RootPath = $PSScriptRoot
[System.IO.FileInfo]$IconPath = Join-Path $RootPath 'Icons'

# This will generate an HTML table with the specified label and logo.
Add-DiaHTMLLabel -Label "Active Directory Forest Diagram" -IconType $CustomLogo -IconDebug $IconDebug -ImagesObj $Images

Example

Text Only
## PARAMETERS

### -CellPadding
Specifies the padding inside the HTML table cells.
Default is 10.

```yaml
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: 10
Accept pipeline input: False
Accept wildcard characters: False

-CellSpacing

Specifies the spacing between HTML table cells. Default is 20.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Default value: 20
Accept pipeline input: False
Accept wildcard characters: False

-FontBold

Switch to render the label text in bold.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FontColor

Specifies the font color for the cell text. Default is "#000000".

YAML
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: #000000
Accept pipeline input: False
Accept wildcard characters: False

-FontItalic

Switch to render the label text in italic.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FontName

Specifies the font family used for the label text. Default is "Segoe Ui".

YAML
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: Segoe Ui
Accept pipeline input: False
Accept wildcard characters: False

-FontOverline

Switch to overline the label text.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Fontsize

Specifies the font size used for the label text. Default is 14.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: 14
Accept pipeline input: False
Accept wildcard characters: False

-FontStrikeThrough

Switch to render the label text with a strikethrough.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FontSubscript

Switch to render the label text as subscript.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FontSuperscript

Switch to render the label text as superscript.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FontUnderline

Switch to underline the label text.

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-IconDebug

Enables debug (draft) mode for icon rendering. When set, a debug table row is included indicating DraftMode.

YAML
Type: System.Boolean
Parameter Sets: (All)
Aliases: DraftMode

Required: False
Position: 7
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-IconHeight

Optional height for the icon in pixels. When provided with IconWidth, a fixed-size image cell is used.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-IconPath

Optional path (directory) containing icon image files. Required when ImageSizePercent is less than 100.

YAML
Type: System.IO.FileInfo
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IconType

The key or name of the icon to use. If set to 'NoIcon' no icon is displayed. Resolved from ImagesObj when available.

YAML
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IconWidth

Optional width for the icon in pixels. When provided with IconHeight, a fixed-size image cell is used.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-ImageSizePercent

Percentage to scale the icon (1-100). Default is 100. When less than 100, IconPath is required and Get-DiaImagePercent is used.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 15
Default value: 100
Accept pipeline input: False
Accept wildcard characters: False

-ImagesObj

Hashtable mapping icon keys to image file names or paths. Default is an empty hashtable.

YAML
Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: False

-Label

The text label used as the diagram title. This parameter is mandatory.

YAML
Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

YAML
Type: System.Management.Automation.ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SubgraphCellPadding

Padding inside HTML table cells when rendering subgraph labels. Default is 5.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 13
Default value: 5
Accept pipeline input: False
Accept wildcard characters: False

-SubgraphCellSpacing

Spacing between HTML table cells when rendering subgraph labels. Default is 5.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 14
Default value: 5
Accept pipeline input: False
Accept wildcard characters: False

-SubgraphLabel

Switch to produce a table formatted for a Graphviz subgraph label (icon and text side-by-side).

YAML
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-TableBorder

Border width for the generated HTML table. Default is 0.

YAML
Type: System.Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 16
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

System.String

NOTES

''' Version: 0.2.30 Author: Jonathan Colon Bluesky: @jcolonfpr.bsky.social GitHub: rebelinux '''