From 368f348c7191da07710b79210d8f4c0054f2247c Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Wed, 21 Apr 2021 16:29:38 +0200 Subject: [PATCH] FullWidth parameter #3 --- Public/New-AdaptiveCard.ps1 | 10 +++------- README.md | 3 ++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Public/New-AdaptiveCard.ps1 b/Public/New-AdaptiveCard.ps1 index 98a9034..25dbbe4 100644 --- a/Public/New-AdaptiveCard.ps1 +++ b/Public/New-AdaptiveCard.ps1 @@ -100,7 +100,7 @@ [string] $SelectActionId, [string] $SelectActionUrl, [string] $SelectActionTitle, - [ValidateSet('Full', 'Small')][string] $Width = 'Full', + [switch] $FullWidth, [switch] $AllowImageExpand ) $Wrapper = [ordered]@{ @@ -132,12 +132,8 @@ if ($AllowImageExpand) { $Wrapper['attachments'][0]['content']['msteams']['allowExpand'] = $true } - if ($Width) { - if ($Width -eq 'Small') { - $Wrapper['attachments'][0]['content']['msteams']['width'] = 'Default' - } else { - $Wrapper['attachments'][0]['content']['msteams']['width'] = 'Full' - } + if ($FullWidth) { + $Wrapper['attachments'][0]['content']['msteams']['width'] = 'Full' } if ($MinimumHeight) { $Wrapper['attachments'][0]['content']['minHeight'] = "$($MinimumHeight)px" diff --git a/README.md b/README.md index ef8b64f..1c28d3e 100644 --- a/README.md +++ b/README.md @@ -407,7 +407,8 @@ Dependencies: **PSSharedGoods**, **PSWriteColor** and **Connectimo** are only us ## Changelog - 2.0.1 / 2021.04.21 - - ☑ Adaptive Cards are now set to Full Width by default. You can set them back to small by using Width parameter + - ☑ Added `FullWidth` switch to `New-AdaptiveCard`. This allows for full width adaptive card. + - ☑ Added `AllowImageExpand` switch to `New-AdaptiveCard`. This allows for expanding on images - 2.0.0 / 2020.11.03 - [x] Added support for [AdaptiveCard](https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#adaptive-card) using `New-AdaptiveCard` - [x] Added `New-AdaptiveActionSet`