Get-HtmlBrowserContent

August 3, 2026 ยท View on GitHub

SYNOPSIS

Cmdlet that retrieves HTML or text content from an existing session.

SYNTAX

__AllParameterSets

Get-HtmlBrowserContent [[-Session] <HtmlBrowserSession>] [-Selector <string>] [-InnerHtml] [-OuterHtml] [-AsText] [-All] [-Limit <int>] [-Timeout <int>] [-CancellationToken <CancellationToken>] [<CommonParameters>]

DESCRIPTION

Cmdlet that retrieves HTML or text content from an existing session.

EXAMPLES

EXAMPLE 1

Get-HtmlBrowserContent -All

PARAMETERS

-All

Return content for all matching elements instead of only the first match.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AsText

Return text content instead of HTML.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CancellationToken

Token used to cancel the operation.

Type: CancellationToken
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InnerHtml

Return inner HTML instead of outer HTML.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Limit

Maximum number of matching elements to return when using All.

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OuterHtml

Return outer HTML. This is the default.

Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Selector

CSS selector for the target element.

Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Session

Browser session in use.

Type: HtmlBrowserSession
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Timeout

Timeout in milliseconds while waiting for the selector.

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

  • HtmlTinkerX.HtmlBrowserSession

OUTPUTS

  • System.String
  • None