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.
Notice how some of the elements do not have a value in some of the properties. It could be null for either ResourceName or CertificateName. In that case, I'd expect the table output in Teams to show nothing for that column. But instead, the values get shifted. So for example, the CertificateName from the second element (abc123) gets shifted to the CertificateName under the first element.
However, $Expired_Table itself has the correct output. It's only when it gets converted to an adaptive table that it becomes messed up.
# Teams webhook send message
$Card = New-AdaptiveCard {
New-AdaptiveTable -DataTable $Table_Expired -HeaderHorizontalAlignment Left -HorizontalAlignment Left -HeaderColor Good -Size Small
} -Uri $teamsWebhook -FullWidth -ReturnJson
There seems to be a bug with the conversion of my PSCustomObject to a New-AdaptiveTable.
Say if I have this:
Notice how some of the elements do not have a value in some of the properties. It could be null for either ResourceName or CertificateName. In that case, I'd expect the table output in Teams to show nothing for that column. But instead, the values get shifted. So for example, the CertificateName from the second element (abc123) gets shifted to the CertificateName under the first element.
However, $Expired_Table itself has the correct output. It's only when it gets converted to an adaptive table that it becomes messed up.