API Reference
New-HTMLText
This function provides ability to add new text to the HTML file.
Remarks
This function provides ability to add new text to the HTML file, with colors, fonts and other styling features. It is used to add text to the HTML file with proper styling and formatting. Please keep in mind that if parameter is not provided the defaults will be used. The defaults can be from the body itself, or from section or other parts of HTML depending on where the text is added.
Examples
EXAMPLE 1
New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\Example34_01.html" {
New-HTMLHeader {
New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
}
New-HTMLMain {
New-HTMLTab -TabName 'Test' {
New-HTMLSection -HeaderText '0 section' {
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
}
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
}
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter -Simplify
}
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
}
}
}
New-HTMLTab -TabName 'Test5' {
New-HTMLSection -HeaderText '1 section' {
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
}
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
# New-HTMLTable -DataTable $Processes -HideFooter
}
New-HTMLPanel {
New-HTMLTable -DataTable $Processes -HideFooter
}
}
}
}
New-HTMLFooter {
New-HTMLText -Text "Date of this report $(Get-Date)" -Color Blue -Alignment right
}
} -Online -ShowHTML
EXAMPLE 2
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-HTMLText [-Alignment <left|center|right|justify>] [-BackGroundColor <String[]>] [-Color <String[]>] [-Direction <rtl|ltr>] [-Display <inline>] [-FontFamily <String[]>] [-FontSize <Object[]>] [-FontStyle <normal|italic|oblique>] [-FontVariant <normal|small-caps>] [-FontWeight <normal>] [-LineBreak] [-LineHeight <String[]>] [-Opacity <Double[]>] [-SkipParagraph] [-Text <String[]>] [-TextBlock <ScriptBlock>] [-TextDecoration <line-through|overline|underline>] [-TextTransform <uppercase|lowercase|capitalize>] [<CommonParameters>]
#
All Parameter SetsParameters
- Alignment String[]
- Provide alignment. When skipped the default alignment will be used. Options are: 'left', 'right', 'center', 'justify'
- Possible values:
left,center,right,justify - BackGroundColor String[]
- Pick one of the 800 colors or provide a hex color code.
- Color String[]
- Pick one of the 800 colors or provide a hex color code.
- Direction String[]
- Provide direction. When skipped the direction will not be changed. Options are: 'rtl','ltr'. By default it's 'ltr'.
- Possible values:
rtl,ltr - Display String[]
- Allows configuring CSS display property. The display property specifies the display behavior (the type of rendering box) of an element. Options are: 'none', 'inline', 'block', 'inline-block', 'contents','flex', 'grid', 'inline-flex', 'inline-grid', 'inline-table', 'list-item', 'run-in', 'table', 'table-caption', 'table-column-group', 'table-header-group', 'table-footer-group', 'table-row-group', 'table-cell', 'table-column', 'table-row'
- Possible values:
inline,block,inline-block,contents,flex,grid,inline-flex,inline-grid,inline-table,list-item,run-in,table,table-caption,table-column-group,table-header-group,table-footer-group,table-row-group,table-cell,table-column,table-row - FontFamily String[]
- Provide font family. When skipped the default font family will be used.
- FontSize Object[]
- Provide font size. When skipped the default font size will be used.
- FontStyle String[]
- Provide font style. When skipped the default font style will be used. Options are: 'normal', 'italic', 'oblique'
- Possible values:
normal,italic,oblique - FontVariant String[]
- Provide font variant. When skipped the default font variant will be used. Options are: 'normal', 'small-caps'
- Possible values:
normal,small-caps - FontWeight String[]
- Provide font weight. When skipped the default font weight will be used. Options are: 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'
- Possible values:
normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900 - LineBreak SwitchParameter
- Decides whether to add line break at the end of the text or not.
- LineHeight String[]
- Provide line height. When skipped the default line height will be used.
- Opacity Double[]
- The opacity property sets the opacity level for an element. Value between 0 and 1. 1 is default.
- SkipParagraph SwitchParameter
- Skips adding div tag to make sure text is not wrapped in it. By default it wraps all text in div tag.
- Text String[]
- Provide text or text array to be added to the HTML file.
- TextBlock ScriptBlock
- Defines ability to use text block instead of array
- TextDecoration String[]
- Provide text decoration. When skipped the default text decoration will be used. Options are: 'none', 'line-through', 'overline', 'underline'
- Possible values:
line-through,overline,underline - TextTransform String[]
- Provide text transform. When skipped the default text transform will be used. Options are: 'uppercase', 'lowercase', 'capitalize'
- Possible values:
uppercase,lowercase,capitalize