ConvertFrom-Html
August 3, 2026 ยท View on GitHub
SYNOPSIS
Parses HTML content from a string or a remote page.
SYNTAX
Content (Default)
ConvertFrom-Html -Content <string> [-Engine <HtmlParserEngine>] [-Proxy <string>] [-ProxyCredential <pscredential>] [-Raw] [<CommonParameters>]
Url
ConvertFrom-Html -Url <uri> [-Engine <HtmlParserEngine>] [-Proxy <string>] [-ProxyCredential <pscredential>] [-UserAgent <string>] [-Header <hashtable>] [-Raw] [<CommonParameters>]
DESCRIPTION
The cmdlet can read raw HTML or download a web page specified with -Url. When downloading, optional -Proxy and -ProxyCredential parameters control the web request.
EXAMPLES
EXAMPLE 1
ConvertFrom-Html -Url https://example.com
EXAMPLE 2
ConvertFrom-Html -Url https://example.com -Proxy http://proxy:8080
PARAMETERS
-Content
HTML content to parse.
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
-Engine
Selects parsing engine.
Type: HtmlParserEngine
Parameter Sets: Content, Url
Aliases: None
Possible values: AngleSharp, AgilityPack
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Header
Additional or replacement HTTP headers used when downloading Url.
Type: Hashtable
Parameter Sets: Url
Aliases: Headers
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Proxy
Optional proxy server address used when fetching content from Url. Include the protocol and port number if required.
Type: String
Parameter Sets: Content, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProxyCredential
Credentials used to authenticate against the Proxy server.
Type: PSCredential
Parameter Sets: Content, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Raw
Return raw document object.
Type: SwitchParameter
Parameter Sets: Content, Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Url
URL of a HTML page.
Type: Uri
Parameter Sets: Url
Aliases: Uri
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-UserAgent
User-Agent header used when downloading Url.
Type: String
Parameter Sets: Url
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
System.String
OUTPUTS
System.Object
RELATED LINKS
- None