API Reference
Command
Add-OfficeExcelImage
Adds an image anchored to a worksheet cell.
Remarks
Adds an image anchored to a worksheet cell.
Examples
Insert an image from disk at B2.
PS>ExcelSheet 'Data' { Add-OfficeExcelImage -Address 'B2' -Path .\logo.png -WidthPixels 120 -HeightPixels 40 }
Anchors the image to cell B2.
Insert an image from a URL.
PS>ExcelSheet 'Data' { Add-OfficeExcelImage -Row 1 -Column 1 -Url 'https://example.org/logo.png' }
Downloads and anchors the image to cell 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
Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] -Path <String> [-Row <Nullable`1>] [-WidthPixels <Int32>] [<CommonParameters>]#Parameter set:
ContextPathParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- HeightPixels Int32
- Image height in pixels.
- OffsetXPixels Int32
- Horizontal offset in pixels from the cell origin.
- OffsetYPixels Int32
- Vertical offset in pixels from the cell origin.
- PassThru SwitchParameter
- Emit the worksheet after inserting the image.
- Path String
- Image file path.
- Row Nullable`1
- 1-based row index.
- WidthPixels Int32
- Image width in pixels.
Outputs
System.Object
Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] -Document <ExcelDocument> [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] -Path <String> [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-WidthPixels <Int32>] [<CommonParameters>]#Parameter set:
DocumentPathParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- HeightPixels Int32
- Image height in pixels.
- OffsetXPixels Int32
- Horizontal offset in pixels from the cell origin.
- OffsetYPixels Int32
- Vertical offset in pixels from the cell origin.
- PassThru SwitchParameter
- Emit the worksheet after inserting the image.
- Path String
- Image file path.
- Row Nullable`1
- 1-based row index.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
- WidthPixels Int32
- Image width in pixels.
Outputs
System.Object
Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] -Document <ExcelDocument> [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] [-Row <Nullable`1>] [-Sheet <String>] [-SheetIndex <Nullable`1>] -Url <String> [-WidthPixels <Int32>] [<CommonParameters>]#Parameter set:
DocumentUrlParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- HeightPixels Int32
- Image height in pixels.
- OffsetXPixels Int32
- Horizontal offset in pixels from the cell origin.
- OffsetYPixels Int32
- Vertical offset in pixels from the cell origin.
- PassThru SwitchParameter
- Emit the worksheet after inserting the image.
- 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
- Image URL to download.
- WidthPixels Int32
- Image width in pixels.
Outputs
System.Object
Add-OfficeExcelImage [-Address <String>] [-Column <Nullable`1>] [-HeightPixels <Int32>] [-OffsetXPixels <Int32>] [-OffsetYPixels <Int32>] [-PassThru] [-Row <Nullable`1>] -Url <String> [-WidthPixels <Int32>] [<CommonParameters>]#Parameter set:
ContextUrlParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Column Nullable`1
- 1-based column index.
- HeightPixels Int32
- Image height in pixels.
- OffsetXPixels Int32
- Horizontal offset in pixels from the cell origin.
- OffsetYPixels Int32
- Vertical offset in pixels from the cell origin.
- PassThru SwitchParameter
- Emit the worksheet after inserting the image.
- Row Nullable`1
- 1-based row index.
- Url String
- Image URL to download.
- WidthPixels Int32
- Image width in pixels.
Outputs
System.Object