Skip to content

Get-SpectreImage

Synopsis

Displays an image in the console using Spectre.Console.CanvasImage.


Description

Displays an image in the console using Spectre.Console.CanvasImage. The image can be resized to a maximum width if desired.


Examples

Displays the image located at “C:\Images\myimage.png” with a maximum width of 80 characters.

Get-SpectreImage -ImagePath "C:\Images\myimage.png" -MaxWidth 80

Parameters

ImagePath

The path to the image file to be displayed.

TypeRequiredPositionPipelineInput
[String]false1false

MaxWidth

The maximum width of the image. If not specified, the image will be displayed at its original size.

TypeRequiredPositionPipelineInput
[Int32]false2false

Syntax

Get-SpectreImage [[-ImagePath] <String>] [[-MaxWidth] <Int32>] [<CommonParameters>]