Cmdlet
Get-OfficeWordHyperlink
Gets hyperlinks from a Word document.
Syntax
Get-OfficeWordHyperlink
[-Anchor <String[]>]
[-Path] <String>
[-Text <String[]>]
[-Url <String[]>]
[<CommonParameters>]#Parameter set:
PathGet-OfficeWordHyperlink
[-Anchor <String[]>]
-Document <WordDocument>
[-Text <String[]>]
[-Url <String[]>]
[<CommonParameters>]#Parameter set:
DocumentGet-OfficeWordHyperlink
[-Anchor <String[]>]
-Section <WordSection>
[-Text <String[]>]
[-Url <String[]>]
[<CommonParameters>]#Parameter set:
SectionGet-OfficeWordHyperlink
[-Anchor <String[]>]
-Paragraph <WordParagraph>
[-Text <String[]>]
[-Url <String[]>]
[<CommonParameters>]#Parameter set:
ParagraphExamples
Audit external hyperlinks in a report.
$links = Get-OfficeWordHyperlink -Path .\Report.docx -Url 'https://*'
$links |
Select-Object -Property Text, Uri |
Export-Csv -Path .\ReportLinks.csv -NoTypeInformationFilters external hyperlinks and exports them for link validation or review.
Parameters
- -Anchor String[]
- Filter by bookmark anchor (wildcards supported).
- -Path String
- Path to the document.
- -Text String[]
- Filter by hyperlink text (wildcards supported).
- -Url String[]
- Filter by external URL (wildcards supported).
- -Document WordDocument
- Document to inspect.
- -Section WordSection
- Section to inspect.
- -Paragraph WordParagraph
- Paragraph to inspect.
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.