EvotecIT / PSTeams

PSTeams is a PowerShell Module working on Windows / Linux and Mac. It allows sending notifications to Microsoft Teams via WebHook Notifications. It's pretty flexible and provides a bunch of options. Initially, it only supported one sort of Team Cards but since version 2.X.X it supports Adaptive Cards, Hero Cards, List Cards, and Thumbnail Cards. All those new cards have their own cmdlets and the old version of creating Teams Cards stays as-is for compatibility reasons.
MIT License
409 stars 41 forks source link

New-AdaptiveTable Doesn't permit variable-width columns #51

Closed ObsidianPhoenix closed 1 year ago

ObsidianPhoenix commented 1 year ago

When using the New-AdaptiveTable function, passing in data results in all columns with identical widths.

image

On investigation, it appears to be due to setting the width to stretch on the columns:

https://github.com/EvotecIT/PSTeams/blob/f532431ef931f50cd94bd9f1768c390e945d01bc/Public/New-AdaptiveTable.ps1#L225

This is from the Renderer Guide on MS:

Columns with only stretch width takes up the remaining spaces after dividing it equally.

For tables with small data columns (e.g. counts), this results in data in longer fields being cut off.

Could we add a property that allows the use of auto for widths?

PrzemyslawKlys commented 1 year ago

Implemented in 2.3.0. Feel free to PR next time :)

ObsidianPhoenix commented 1 year ago

Cheers.

Will do: typically I follow the MS process, and don't PR unless it's approved by the owners.

Great job on the module btw. Definitely seems to make it easier

PrzemyslawKlys commented 1 year ago

I am not MS, I need help :D If things can be more configurable - great. If things can be improved - even better.