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

New-HTMLWinBox

Module PSWriteHTML

Creates a customizable HTML window box with various options for styling and functionality.

Syntax

New-HTMLWinBox [[-BackgroundColor] <String>] [[-Border] <String>] [[-Bottom] <String>] [[-Height] <String>] [[-HTML] <ScriptBlock>] [[-Index] <Nullable`1>] [[-Left] <String>] [-Maximize] [-Modal] [-NoAnimation] [-NoCloseIcon] [-NoFullScreenIcon] [-NoHeader] [-NoMaximizeIcon] [-NoMinmizeIcon] [-NoMoveCapability] [-NoResizeCapability] [-NoShadow] [[-Right] <String>] [[-Theme] <modern|white>] [[-Title] <String>] [[-Top] <String>] [[-Url] <Uri>] [[-Width] <String>] [[-X] <String>] [[-Y] <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function allows you to create an HTML window box with customizable features such as title, background color, initial position, size, URL content, modal display, theme, and more.

Examples

Authored help example

EXAMPLE 1

$Data = Get-Process | Select-Object -First 3

New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\Example-WinBox01.html" { New-HTMLWinBox -Title 'This is a test Window' -BackgroundColor Red { New-HTMLText -Text 'This is a text within modal dialog' New-HTMLTable -DataTable $Data } -Width 50% -Height 50% -X center -Y center } -Online -ShowHTML

Parameters

-BackgroundColor String optionalposition: 2
Specifies the background color of the window box title.
-Border String optionalposition: 4
Set the border width of the window (supports all css units, like px, %, em, rem, vh, vmax).
-Bottom String optionalposition: 11
Set or limit the viewport of the window's available area (supports units "px" and "%").
-Height String optionalposition: 5
Set the initial width/height of the window (supports units "px" and "%").
-HTML ScriptBlock optionalposition: 0
Specifies the HTML content to be displayed within the window box.
-Index Nullable`1 optionalposition: 3
Set the initial z-index of the window to this value (could be increased automatically when unfocused/focused).
-Left String optionalposition: 12
Set or limit the viewport of the window's available area (supports units "px" and "%").
-Maximize SwitchParameter optional
Automatically maximizes the window box when created.
-Modal SwitchParameter optional
Indicates whether the window box should be displayed as a modal window.
-NoAnimation SwitchParameter optional
Disables transition animations for the window box.
-NoCloseIcon SwitchParameter optional
Hides the close icon in the window box.
-NoFullScreenIcon SwitchParameter optional
Hides the fullscreen icon in the window box.
-NoHeader SwitchParameter optional
Hides the header of the window box, including the title and toolbar.
-NoMaximizeIcon SwitchParameter optional
Hides the maximize icon in the window box.
-NoMinmizeIcon SwitchParameter optional
Hides the minimize icon in the window box.
-NoMoveCapability SwitchParameter optional
Disables the moving capability of the window box.
-NoResizeCapability SwitchParameter optional
Disables the resizing capability of the window box.
-NoShadow SwitchParameter optional
Disables the drop shadow effect for the window box.
-Right String optionalposition: 10
Set or limit the viewport of the window's available area (supports units "px" and "%").
-Theme String optionalposition: 14
Specifies the theme of the window box.
Possible values: modern, white
-Title String optionalposition: 1
Specifies the title of the window box.
-Top String optionalposition: 9
Set or limit the viewport of the window's available area (supports units "px" and "%").
-Url Uri optionalposition: 13aliases: Uri
Specifies the URL content to be loaded inside the window box via iframe.
-Width String optionalposition: 6
Set the initial width/height of the window (supports units "px" and "%").
-X String optionalposition: 7
Set the initial position of the window (supports: "right" for x-axis, "bottom" for y-axis, "center" for both, units "px" and "%" for both).
-Y String optionalposition: 8
Set the initial position of the window (supports: "right" for x-axis, "bottom" for y-axis, "center" for both, units "px" and "%" for both).

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.