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-HTMLImage

Module PSWriteHTML

Creates IMG tag with image link or image bundled inline

Syntax

New-HTMLImage [[-AlternativeText] <String>] [[-Class] <String>] [-DisableCache] [[-Height] <Object>] [-Inline] [[-Source] <String>] [[-Target] <String>] [[-UrlLink] <Uri>] [[-Width] <Object>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

EXAMPLE 1

New-HTMLImage -Source 'https://evotec.pl/image.png' -UrlLink 'https://evotec.pl/' -AlternativeText 'My other text' -Class 'otehr' -Width '100%'

Parameters

-AlternativeText String optionalposition: 2
Specifies an alternate text for the image, if the image for some reason cannot be displayed
-Class String optionalposition: 3
Overwrites default CSS settings for links
-DisableCache SwitchParameter optional
-Height Object optionalposition: 6
Height of an image (optional)
-Inline SwitchParameter optional
Inserts given Image URL/File directly into HTML
-Source String optionalposition: 0
Link to an image or file path to an image
-Target String optionalposition: 4
The target attribute specifies where to open the linked document. - _blank Opens the linked document in a new window or tab - _self Opens the linked document in the same frame as it was clicked (this is default) - _parent Opens the linked document in the parent frame - _top Opens the linked document in the full body of the window Additionally framename can be given. Default is _blank
Specifies the URL of the page the link goes to when user clicks an image
-Width Object optionalposition: 5
Width of an image (optional)

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.