API Reference
New-HTMLTag
Creates a new HTML tag with specified attributes and content.
Remarks
The New-HTMLTag function creates a new HTML tag with the specified tag name, attributes, and content. It supports self-closing tags, custom attributes, and new line formatting.
Examples
EXAMPLE 1
New-HTMLTag -Tag "div" -Attributes @{ class = "container" } -Value { "Hello, World!" }
Creates a <div> tag with the class attribute set to "container" and the content "Hello, World!".
EXAMPLE 2
New-HTMLTag -Tag "img" -Attributes @{ src = "image.jpg"; alt = "Image" } -SelfClosing
Creates an <img> tag with the src and alt attributes set and is self-closing.
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-HTMLTag [-Attributes <IDictionary>] [-NewLine] [-NoClosing] [-SelfClosing] -Tag <String> [-Value <ScriptBlock>] [<CommonParameters>]
#
All Parameter SetsParameters
- Attributes IDictionary
- Specifies additional attributes for the HTML tag.
- NewLine SwitchParameter
- Indicates whether a new line should be added after the HTML tag.
- NoClosing SwitchParameter
- Indicates whether the HTML tag should not have a closing tag.
- SelfClosing SwitchParameter
- Indicates whether the HTML tag is self-closing.
- Tag String
- Specifies the name of the HTML tag to create.
- Value ScriptBlock
- Specifies the content of the HTML tag as a script block.