ConvertFrom-HtmlTable
August 3, 2026 ยท View on GitHub
SYNOPSIS
Converts HTML tables into PowerShell objects.
SYNTAX
Content (Default)
ConvertFrom-HtmlTable -Content <string> [-ReplaceContent <IDictionary>] [-ReplaceHeaders <IDictionary>] [-Engine <HtmlParserEngine>] [-ReverseTable] [-IncludeMetadata] [-AsDataTable] [-AsDataSet] [-TableName <string>] [-DataSetName <string>] [-InferTypes] [-IncludeLinkUrls] [-TableIndex <int[]>] [-TableId <string>] [-TableClass <string>] [-Caption <string>] [-Header <string>] [-AllProperties] [-EmptyValuePlaceholder <string>] [-CleanHeaders] [-SkipFooter] [-CellTextFormat <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [<CommonParameters>]
File
ConvertFrom-HtmlTable -Path <string> [-ReplaceContent <IDictionary>] [-ReplaceHeaders <IDictionary>] [-Engine <HtmlParserEngine>] [-ReverseTable] [-IncludeMetadata] [-AsDataTable] [-AsDataSet] [-TableName <string>] [-DataSetName <string>] [-InferTypes] [-IncludeLinkUrls] [-TableIndex <int[]>] [-TableId <string>] [-TableClass <string>] [-Caption <string>] [-Header <string>] [-AllProperties] [-EmptyValuePlaceholder <string>] [-CleanHeaders] [-SkipFooter] [-CellTextFormat <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [<CommonParameters>]
Url
ConvertFrom-HtmlTable -Url <uri> [-ReplaceContent <IDictionary>] [-ReplaceHeaders <IDictionary>] [-Engine <HtmlParserEngine>] [-ReverseTable] [-IncludeMetadata] [-AsDataTable] [-AsDataSet] [-TableName <string>] [-DataSetName <string>] [-InferTypes] [-IncludeLinkUrls] [-TableIndex <int[]>] [-TableId <string>] [-TableClass <string>] [-Caption <string>] [-Header <string>] [-AllProperties] [-EmptyValuePlaceholder <string>] [-CleanHeaders] [-SkipFooter] [-CellTextFormat <string>] [-Proxy <string>] [-ProxyCredential <pscredential>] [<CommonParameters>]
DESCRIPTION
The cmdlet accepts raw HTML or downloads a page using -Url. When downloading you can specify -Proxy and -ProxyCredential.
EXAMPLES
EXAMPLE 1
ConvertFrom-HtmlTable -Url https://example.com
EXAMPLE 2
ConvertFrom-HtmlTable -Url https://example.com -Proxy http://proxy:8080
PARAMETERS
-AllProperties
Pad rows with missing cells.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AsDataSet
Return all parsed HTML tables as a DataSet.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AsDataTable
Return each parsed HTML table as a DataTable.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Caption
Caption text fragment to include.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CellTextFormat
Controls how cell text is extracted (Compact, Lines, Markdown).
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values: Compact, Lines, Markdown
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CleanHeaders
Automatically clean special characters from header names that can cause PowerShell formatting issues.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Content
HTML content containing tables.
Type: String
Parameter Sets: Content
Aliases: None
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: True (ByValue, ByPropertyName)
Accept wildcard characters: False
-DataSetName
Name to use when returning a DataSet.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-EmptyValuePlaceholder
Value to use for empty cells to improve PowerShell formatting compatibility.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Engine
Selects parsing engine.
Type: HtmlParserEngine
Parameter Sets: Content, File, Url
Aliases: None
Possible values: AngleSharp, AgilityPack
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Header
Header name to include.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeLinkUrls
Add companion URL columns for linked table cells.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeMetadata
Include table metadata information.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InferTypes
Infer simple .NET column types when returning DataTable/DataSet output.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Path
Path to an HTML file containing tables.
Type: String
Parameter Sets: File
Aliases: None
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Proxy
Proxy server address used when Url is specified. Include protocol and port if required.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProxyCredential
Credentials used for authenticating with the specified Proxy server.
Type: PSCredential
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ReplaceContent
Replacements to apply to table cell contents.
Type: IDictionary
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ReplaceHeaders
Replacements to apply to table headers.
Type: IDictionary
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ReverseTable
Interpret table rows as key/value pairs.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SkipFooter
Skip HTML table footer () elements when parsing tables.
Type: SwitchParameter
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TableClass
CSS class token to include.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TableId
Table id to include.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TableIndex
Zero-based table indexes to include.
Type: Int32[]
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-TableName
Name to use when returning a single DataTable.
Type: String
Parameter Sets: Content, File, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Url
URL of a page with tables.
Type: Uri
Parameter Sets: Url
Aliases: Uri
Possible values:
Required: True
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
System.String
OUTPUTS
System.Management.Automation.PSObject[]System.Data.DataTableSystem.Data.DataSet
RELATED LINKS
- None