Skip to content

Commit

Permalink
Preserve type of IDictionary object instead of casting to [hashtable]
Browse files Browse the repository at this point in the history
Fixes #175. This will preserve the ordering of keys in the collection
  • Loading branch information
devblackops committed Aug 31, 2019
1 parent 5c2de14 commit f9e9f7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.11.8] Unreleased
## [0.11.8] 2019-08-30

### Fixed

- Commands will no longer be re-executed if a user replies to the original command with a threaded message
- The formatting of large message responses to Slack has been fixed
- New-PoshBotCardResponse now accepts any object of type `System.Collections.IDictionary` instead of always casting to `System.Collections.Hashtable`. This will preserve the ordering of keys if the supplied object supports it.

## [0.11.7] 2019-08-09

Expand Down
2 changes: 1 addition & 1 deletion PoshBot/Public/New-PoshBotCardResponse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function New-PoshBotCardResponse {
})]
[string]$LinkUrl,

[hashtable]$Fields,
[System.Collections.IDictionary]$Fields,

[ValidateScript({
if ($_ -match '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$') {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/functions/new-poshbotcardresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Tells PoshBot to send a specially formatted response.

```
New-PoshBotCardResponse [[-Type] <String>] [-DM] [[-Text] <String>] [[-Title] <String>]
[[-ThumbnailUrl] <String>] [[-ImageUrl] <String>] [[-LinkUrl] <String>] [[-Fields] <Hashtable>]
[[-ThumbnailUrl] <String>] [[-ImageUrl] <String>] [[-LinkUrl] <String>] [[-Fields] <IDictionary>]
[[-Color] <String>] [[-CustomData] <Object>] [<CommonParameters>]
```

Expand Down Expand Up @@ -191,7 +191,7 @@ Accept wildcard characters: False
A hashtable to display as a table in the card response.
```yaml
Type: Hashtable
Type: IDictionary
Parameter Sets: (All)
Aliases:

Expand Down

0 comments on commit f9e9f7f

Please sign in to comment.