Cmdlet
New-ConsoleImage
Creates an image to place inside panels, columns and dashboards.
Syntax
Description
Inside layouts and live dashboards the image is drawn with half blocks on terminals with 256 colours or more, so it redraws cleanly with the rest of the screen; redirected and no-colour output gets [image: name WxH]. To print an image on its own with the terminal's real pixels, use Show-ConsoleImage.
Examples
Example 1
New-ConsoleColumns -Content { New-ConsolePanel -Title 'Latency' -Content { New-ConsoleImage -Path ./latency.png -Width 40 }; New-ConsolePanel -Title 'Summary' -Content { New-ConsoleKeyValue -InputObject ([ordered] @{ P50 = '41 ms'; P99 = '180 ms' }) } } | Show-ConsoleA chart next to its numbers
Parameters
- -Height Int32
- Height in cells. With -Width as well, the image fits inside that box; the aspect ratio is always kept.
- -Label String
- The text in the placeholder that redirected and CI output get, [image: label WxH]. Defaults to the file name.
- -Path String
- A PNG, JPEG, GIF, BMP, TIFF or PPM file. Files from Get-ChildItem and path strings can also be piped in.
- -Width Int32
- Width in cells. Without -Width or -Height the image takes one cell per 10 pixels, up to the window width.
- -Bytes Byte[]
- Encoded image bytes, for example a chart rendered to PNG in memory.
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.