Evotec

Project

PSWriteHTML

PSWriteHTML is an open-source PowerShell project with packages, release history, and working documentation.

Stars 995
Forks 114
Open issues 69
PowerShell Gallery downloads 7,436,513
Release v1.41.0
Language: PowerShell Updated: 2026-04-11

API Reference

Function

New-HTMLTextBox

Namespace PSWriteHTML

Adds text to HTML where each line in TextBlock is treated as next line (adds BR to each line)

Remarks

Adds text to HTML where each line in TextBlock is treated as next line (adds BR to each line). Automatic line breaks are main feature that differentiate New-HTMLTextBox from New-HTMLText where TextBlock is treated as single line of text unless LineBreak switch is used.

Examples

Authored help example

EXAMPLE 1


New-HTMLTextBox {
    "Hello $UserNotify,"
    ""
    "Your password is due to expire in $PasswordExpiryDays days."
    ""
    'To change your password: '
    '- press CTRL+ALT+DEL -> Change a password...'
    ''
    'If you have forgotten your password and need to reset it, you can do this by clicking here. '
    "In case of problems please contact the HelpDesk by visiting [Evotec Website](https://evotec.xyz) or by sending an email to Help Desk."
    ''
    'Alternatively you can always call Help Desk at +48 22 00 00 00'
    ''
    'Kind regards,'
    'Evotec IT'
}
        

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-HTMLTextBox [-Alignment <left|center|right|justify>] [-BackGroundColor <String[]>] [-Color <String[]>] [-Direction <rtl>] [-FontFamily <String[]>] [-FontSize <Int32[]>] [-FontStyle <normal|italic|oblique>] [-FontVariant <normal|small-caps>] [-FontWeight <normal>] [-LineBreak] [-TextBlock <ScriptBlock>] [-TextDecoration <line-through|overline|underline>] [-TextTransform <uppercase|lowercase|capitalize>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Alignment String[] optionalposition: namedpipeline: Falsevalues: 4
Chhoose Alignment
Possible values: left, center, right, justify
BackGroundColor String[] optionalposition: namedpipeline: False
Color of Background for a Text to set. Choose one or more colors from up to 800 defined colors. Alternatively provide your own Hex value
Color String[] optionalposition: namedpipeline: False
Color of Text to set. Choose one or more colors from up to 800 defined colors. Alternatively provide your own Hex value
Direction String[] optionalposition: namedpipeline: Falsevalues: 1
Parameter description
Possible values: rtl
FontFamily String[] optionalposition: namedpipeline: False
Parameter description
FontSize Int32[] optionalposition: namedpipeline: Falsealiases: Size
Choose FontSize. You can provide just int value which will assume pixels or string value with any other size value.
FontStyle String[] optionalposition: namedpipeline: Falsevalues: 3
Parameter description
Possible values: normal, italic, oblique
FontVariant String[] optionalposition: namedpipeline: Falsevalues: 2
Parameter description
Possible values: normal, small-caps
FontWeight String[] optionalposition: namedpipeline: Falsevalues: 13
Parameter description
Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
LineBreak SwitchParameter optionalposition: namedpipeline: False
Parameter description
TextBlock ScriptBlock optionalposition: 0pipeline: False
ScriptBlock of one or more strings
TextDecoration String[] optionalposition: namedpipeline: Falsevalues: 3
Parameter description
Possible values: line-through, overline, underline
TextTransform String[] optionalposition: namedpipeline: Falsevalues: 3
Parameter description
Possible values: uppercase, lowercase, capitalize