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

Question more than issue #52

Closed EMarcais closed 1 year ago

EMarcais commented 1 year ago

Hi! Thanks for the module this is perfect.

I'm working on getting a text parsed correctly to be displayed as a paragraph with some newlines. Don't think it's an issue but i'm stuck on this one.

I tried: $text.replace(". ",". \n\n") New-AdaptiveTextBlock -Text "$text" -Wrap and the result in -returnJson is: BlabLaBla. \\n\\nBlablaBla

But the only think that is displayed is the \n\n characters in the text visible in Teams.

Best!

PrzemyslawKlys commented 1 year ago

You should use "PowerShell" way for new lines.

New-AdaptiveTextBlock -Text "Now that we have defined the main `n`n rules and features of the format, we need to produce a schema and publish it to GitHub. The schema will be the starting point of our reference documentation." -Wrap

This will be converted to \n\n and it will work.

EMarcais commented 1 year ago

This is the best results: replace(". ",". \`n")

PrzemyslawKlys commented 1 year ago

It has to be double n. Not just one.

EMarcais commented 1 year ago

To me this is the only it behave like it should. This is weird.

PrzemyslawKlys commented 1 year ago

As long as it works ;)