API Reference
Command
Set-OfficeExcelHyperlink
Sets a hyperlink on a worksheet cell.
Remarks
Sets a hyperlink on a worksheet cell.
Examples
Set an external hyperlink.
PS>ExcelSheet 'Data' { Set-OfficeExcelHyperlink -Address 'A1' -Url 'https://example.org' -Display 'Example' }
Creates a styled hyperlink in A1.
Set an internal hyperlink.
PS>ExcelSheet 'Data' { Set-OfficeExcelHyperlink -Row 2 -Column 1 -TargetSheet 'Summary' -TargetAddress 'A1' -Display 'Go to Summary' }
Links A2 to Summary!A1.
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.
Syntax
Set-OfficeExcelHyperlink [-Address <String>] [-Column <Nullable`1>] [-Display <String>] [-NoStyle] [-PassThru] [-Row <Nullable`1>] -Url <String> [<CommonParameters>]#Parameter set:
ContextExternalParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Display String
- Optional display text.
- NoStyle SwitchParameter
- Skip hyperlink styling (blue + underline).
- PassThru SwitchParameter
- Emit the worksheet after setting the link.
- Row Nullable`1
- 1-based row index.
- Url String
- External URL to link to.
Outputs
System.Object
Set-OfficeExcelHyperlink [-Address <String>] [-Column <Nullable`1>] [-Display <String>] -Document <ExcelDocument> [-NoStyle] [-PassThru] [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Url <String> [<CommonParameters>]#Parameter set:
DocumentExternalParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Display String
- Optional display text.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- NoStyle SwitchParameter
- Skip hyperlink styling (blue + underline).
- PassThru SwitchParameter
- Emit the worksheet after setting the link.
- Row Nullable`1
- 1-based row index.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
- Url String
- External URL to link to.
Outputs
System.Object
Set-OfficeExcelHyperlink [-Address <String>] [-Column <Nullable`1>] [-Display <String>] -Document <ExcelDocument> [-Location <String>] [-NoStyle] [-PassThru] [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TargetAddress <String>] [-TargetSheet <String>] [<CommonParameters>]#Parameter set:
DocumentInternalParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Display String
- Optional display text.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- Location String
- Internal location to link to (e.g., "'Summary'!A1").
- NoStyle SwitchParameter
- Skip hyperlink styling (blue + underline).
- PassThru SwitchParameter
- Emit the worksheet after setting the link.
- Row Nullable`1
- 1-based row index.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
- TargetAddress String
- Target A1 address for internal links.
- TargetSheet String
- Target worksheet name for internal links.
Outputs
System.Object
Set-OfficeExcelHyperlink [-Address <String>] [-Column <Nullable`1>] [-Display <String>] [-Location <String>] [-NoStyle] [-PassThru] [-Row <Nullable`1>] [-TargetAddress <String>] [-TargetSheet <String>] [<CommonParameters>]#Parameter set:
ContextInternalParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Display String
- Optional display text.
- Location String
- Internal location to link to (e.g., "'Summary'!A1").
- NoStyle SwitchParameter
- Skip hyperlink styling (blue + underline).
- PassThru SwitchParameter
- Emit the worksheet after setting the link.
- Row Nullable`1
- 1-based row index.
- TargetAddress String
- Target A1 address for internal links.
- TargetSheet String
- Target worksheet name for internal links.
Outputs
System.Object