Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Add-OfficeExcelImageFromUrl

Aliases: ExcelImageFromUrl
Module
PSWriteOffice
Aliases
ExcelImageFromUrl
Inputs
OfficeIMO.Excel.ExcelDocument

Adds an image from a URL anchored to a worksheet cell or range.

Syntax

Add-OfficeExcelImageFromUrl
[-Address <String>]
[-AltText <String>]
[-Column <Int32>]
[-Decorative]
[-EndOffsetXPixels <Int32>]
[-EndOffsetYPixels <Int32>]
[-HeightPixels <Int32>]
[-Name <String>]
[-NoLockAspectRatio]
[-OffsetXPixels <Int32>]
[-OffsetYPixels <Int32>]
[-PassThru]
[-Placement <MoveAndSize|MoveOnly|FreeFloating>]
[-Range <String>]
[-RotationDegrees <Double>]
[-Row <Int32>]
[-ScalePercent <Double>]
[-Title <String>]
[-Url] <String>
[-WidthPixels <Int32>]
[<CommonParameters>]
#
Parameter set: Context
Add-OfficeExcelImageFromUrl
[-Address <String>]
[-AltText <String>]
[-Column <Int32>]
[-Decorative]
-Document <ExcelDocument>
[-EndOffsetXPixels <Int32>]
[-EndOffsetYPixels <Int32>]
[-HeightPixels <Int32>]
[-Name <String>]
[-NoLockAspectRatio]
[-OffsetXPixels <Int32>]
[-OffsetYPixels <Int32>]
[-PassThru]
[-Placement <MoveAndSize|MoveOnly|FreeFloating>]
[-Range <String>]
[-RotationDegrees <Double>]
[-Row <Int32>]
[-ScalePercent <Double>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-Title <String>]
[-Url] <String>
[-WidthPixels <Int32>]
[<CommonParameters>]
#
Parameter set: Document

Examples

Insert a scaled image from a URL at B2.

ExcelSheet 'Data' { Add-OfficeExcelImageFromUrl -Address 'B2' -Url 'https://example.org/logo.png' -ScalePercent 20 -Name Logo -AltText 'Company logo' }

Downloads the remote image, sizes it to 20 percent of its original dimensions, and anchors it to cell B2.

Pin a URL image to a worksheet range.

ExcelSheet 'Data' { Add-OfficeExcelImageFromUrl -Range 'A1:C15' -Url 'https://example.org/logo.png' -Placement MoveAndSize }

Uses Excel's two-cell anchor so the image moves and resizes with the cells in A1:C15.

Parameters

-Address String optionalaliases: Cell
A1-style cell address (e.g., A1, C5).
-AltText String optional
Optional alternative text description for accessibility.
-Column Int32 optional
1-based column index.
-Decorative SwitchParameter optional
Marks the image as decorative by clearing alternative text metadata.
-EndOffsetXPixels Int32 optional
Horizontal offset in pixels for the range end marker when using Range.
-EndOffsetYPixels Int32 optional
Vertical offset in pixels for the range end marker when using Range.
-HeightPixels Int32 optionalaliases: Height
Image height in pixels.
-Name String optional
Optional drawing name used by Excel's selection pane.
-NoLockAspectRatio SwitchParameter optional
Do not lock the image aspect ratio in Excel.
-OffsetXPixels Int32 optional
Horizontal offset in pixels from the cell origin.
-OffsetYPixels Int32 optional
Vertical offset in pixels from the cell origin.
-PassThru SwitchParameter optional
Emit the worksheet after inserting the image.
-Placement ExcelImagePlacement optional
How a range-anchored image behaves when cells move or resize.
Possible values: MoveAndSize, MoveOnly, FreeFloating
-Range String optional
A1-style range (for example, A1:C15) for a two-cell anchor that can move and resize with cells.
-RotationDegrees Double optional
Clockwise image rotation in degrees.
-Row Int32 optional
1-based row index.
-ScalePercent Double optional
Percentage of the original image size. Cannot be combined with WidthPixels or HeightPixels.
-Title String optional
Optional alternative text title.
-Url String requiredposition: 0
Image URL to download.
-WidthPixels Int32 optionalaliases: Width
Image width in pixels.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Workbook to operate on outside the DSL context.
-Sheet String optionalsets: Document
Worksheet name when using Document.
-SheetIndex Int32 optionalsets: Document
Worksheet index (0-based) when using Document.

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.