Get-HtmlResource
August 3, 2026 ยท View on GitHub
SYNOPSIS
Parses external and inline resources and returns their links or downloads them.
SYNTAX
Content (Default)
Get-HtmlResource -Content <string> [-OutDirectory <string>] [-Download] [-IncludeCss] [-IncludeInline] [-AsContent] [<CommonParameters>]
File
Get-HtmlResource -Path <string> [-OutDirectory <string>] [-Download] [-IncludeCss] [-IncludeInline] [-AsContent] [<CommonParameters>]
Url
Get-HtmlResource -Url <uri> [-Proxy <string>] [-ProxyCredential <pscredential>] [-OutDirectory <string>] [-Download] [-IncludeCss] [-IncludeInline] [-AsContent] [<CommonParameters>]
DESCRIPTION
Parses external and inline resources and returns their links or downloads them.
EXAMPLES
EXAMPLE 1
Get-HtmlResource -Content 'Value'
EXAMPLE 2
Get-HtmlResource -Path 'C:\Path'
EXAMPLE 3
Get-HtmlResource -Url 'Value'
PARAMETERS
-AsContent
Return the content of external resources.
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 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
-Download
Download the scripts instead of returning URLs. Only valid with -Url.
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
-IncludeCss
Include CSS and <pre class="shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#22863A">Type</span><span style="color:#24292E">: </span><span style="color:#032F62">SwitchParameter</span></span> <span class="line"><span style="color:#22863A">Parameter Sets</span><span style="color:#24292E">: </span><span style="color:#032F62">Content, File, Url</span></span> <span class="line"><span style="color:#22863A">Aliases</span><span style="color:#24292E">: </span><span style="color:#032F62">None</span></span> <span class="line"><span style="color:#22863A">Possible values</span><span style="color:#24292E">:</span></span> <span class="line"></span> <span class="line"><span style="color:#22863A">Required</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"><span style="color:#22863A">Position</span><span style="color:#24292E">: </span><span style="color:#032F62">named</span></span> <span class="line"><span style="color:#22863A">Default value</span><span style="color:#24292E">: </span><span style="color:#032F62">None</span></span> <span class="line"><span style="color:#22863A">Accept pipeline input</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"><span style="color:#22863A">Accept wildcard characters</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"></span></code>
-IncludeInline
Include inline <pre class="shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#22863A">Type</span><span style="color:#24292E">: </span><span style="color:#032F62">SwitchParameter</span></span> <span class="line"><span style="color:#22863A">Parameter Sets</span><span style="color:#24292E">: </span><span style="color:#032F62">Content, File, Url</span></span> <span class="line"><span style="color:#22863A">Aliases</span><span style="color:#24292E">: </span><span style="color:#032F62">None</span></span> <span class="line"><span style="color:#22863A">Possible values</span><span style="color:#24292E">:</span></span> <span class="line"></span> <span class="line"><span style="color:#22863A">Required</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"><span style="color:#22863A">Position</span><span style="color:#24292E">: </span><span style="color:#032F62">named</span></span> <span class="line"><span style="color:#22863A">Default value</span><span style="color:#24292E">: </span><span style="color:#032F62">None</span></span> <span class="line"><span style="color:#22863A">Accept pipeline input</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"><span style="color:#22863A">Accept wildcard characters</span><span style="color:#24292E">: </span><span style="color:#005CC5">False</span></span> <span class="line"></span></code>
-OutDirectory
Directory where scripts will be saved when Download is specified.
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
-Path
Path to an HTML file.
Type: String
Parameter Sets: File
Aliases: File
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Proxy
Proxy server address used when downloading by 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
-ProxyCredential
Credentials for the specified proxy server.
Type: PSCredential
Parameter Sets: Url
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Url
URL of an 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
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
HtmlTinkerX.HtmlResourceLink
RELATED LINKS
- None