Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

EmailBody

Module PSWriteHTML

Defines styling properties for an email body content.

Syntax

EmailBody [-Alignment <left|center|right|justify>] [-BackGroundColor <String>] [-Color <String>] [-Direction <rtl>] [[-EmailBody] <ScriptBlock>] [-FontFamily <String>] [-FontSize <Object>] [-FontStyle <normal|italic|oblique>] [-FontVariant <normal|small-caps>] [-FontWeight <String>] [-Format] [-LineHeight <String>] [-Minify] [-Online] [-Parameter <IDictionary>] [-TextDecoration <line-through|overline|underline>] [-TextTransform <uppercase|lowercase|capitalize>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function defines styling properties for an email body content such as color, background color, font size, font weight, font style, font family, alignment, text decoration, text transform, direction, and more.

Examples

Authored help example

EXAMPLE 1

EmailBody -Alignment 'Value'

Parameters

-Alignment String optional
Specifies the alignment of the text in the email body. Valid values are 'left', 'center', 'right', or 'justify'.
Possible values: left, center, right, justify
-BackGroundColor String optional
Specifies the background color of the email body.
-Color String optional
Specifies the color of the text in the email body.
-Direction String optional
Specifies the direction of the text in the email body. Valid value is 'rtl'.
Possible values: rtl
-EmailBody ScriptBlock optionalposition: 0
Specifies the ScriptBlock containing the email body content.
-FontFamily String optional
Specifies the font family of the text in the email body.
-FontSize Object optionalaliases: Size
-FontStyle String optional
Specifies the style of the font in the email body. Valid values are 'normal', 'italic', or 'oblique'.
Possible values: normal, italic, oblique
-FontVariant String optional
Specifies the variant of the font in the email body. Valid values are 'normal' or 'small-caps'.
Possible values: normal, small-caps
-FontWeight String optional
Specifies the weight of the font in the email body. Valid values are 'normal', 'bold', 'bolder', 'lighter', or numeric values from 100 to 900.
Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900
-Format SwitchParameter optional
Switch parameter to format the email body content.
-LineHeight String optional
Specifies the line height of the text in the email body.
-Minify SwitchParameter optional
Switch parameter to minify the email body content.
-Online SwitchParameter optional
Switch parameter to indicate if the email body content is online.
-Parameter IDictionary optional
Specifies additional parameters for styling the email body content.
-TextDecoration String optional
Specifies the decoration of the text in the email body. Valid values are 'none', 'line-through', 'overline', or 'underline'.
Possible values: line-through, overline, underline
-TextTransform String optional
Specifies the transformation of the text in the email body. Valid values are 'uppercase', 'lowercase', or 'capitalize'.
Possible values: uppercase, lowercase, capitalize

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.