Title: Support hashtable initializers for all IDictionary types · Issue #13873 · PowerShell/PowerShell · GitHub
Open Graph Title: Support hashtable initializers for all IDictionary types · Issue #13873 · PowerShell/PowerShell
X Title: Support hashtable initializers for all IDictionary types · Issue #13873 · PowerShell/PowerShell
Description: Summary of the new feature/enhancement .NET offers a number of specialized dictionary types that all implement the IDictionary interface. [hashtable] (and [ordered] (System.Collections.Specialized.OrderedDictionary)) conveniently have a ...
Open Graph Description: Summary of the new feature/enhancement .NET offers a number of specialized dictionary types that all implement the IDictionary interface. [hashtable] (and [ordered] (System.Collections.Specialized....
X Description: Summary of the new feature/enhancement .NET offers a number of specialized dictionary types that all implement the IDictionary interface. [hashtable] (and [ordered] (System.Collections.Specialized....
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13873
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support hashtable initializers for all IDictionary types","articleBody":"## Summary of the new feature/enhancement\r\n\r\n.NET offers a number of specialized dictionary types that all implement the `IDictionary` interface.\r\n`[hashtable]` (and `[ordered]` (`System.Collections.Specialized.OrderedDictionary`)) conveniently have a literal syntax in PowerShell, but it would be nice if other types of dictionaries could be _initialized_ via such a hashtable literal (`@{ ... }`):\r\n\r\nThe following, which initializes a non-generic sorted dictionary (a list that also acts as a dictionary) already works:\r\n\r\n```powershell\r\n# OK, for this specific type:\r\nPS> [System.Collections.SortedList] @{ one = 1; two = 2 }\r\n\r\nName Value\r\n---- -----\r\none 1\r\ntwo 2\r\n```\r\n\r\nThe following are examples of other `IDictionary`-implementing types that do NOT work, but it would be nice if they did:\r\n\r\n```powershell\r\n[System.Collections.Generic.SortedList[string, int]] @{ one = 1; two = 2 }\r\n[System.Collections.Generic.SortedDictionary[string, int]] @{ one = 1; two = 2 }\r\n[System.Collections.Generic.Dictionary[string, int]] @{ one = 1; two = 2 }\r\n```\r\n\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-10-25T17:45:23Z","url":"https://github.com/PowerShell/PowerShell/issues/13873"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:22201e56-6fe9-f3b5-97ab-0289c6159d13 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E792:178F0E:E0DD2D:1436D91:6AFDB3E4 |
| html-safe-nonce | e3f1b51d4e948b89d95eb49a377d86139ee67d3123539a334711fc8de506ddf2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzkyOjE3OEYwRTpFMEREMkQ6MTQzNkQ5MTo2QUZEQjNFNCIsInZpc2l0b3JfaWQiOiI4OTM2NDc4ODY2MjA1OTQ2ODUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5d1dd2c97d919a1258570feae76c09d6ff392cfd6d3f964b38be5fdd682fdb0f |
| hovercard-subject-tag | issue:729073307 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/13873/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c6342d64cdea9b78ef10f21d6b03ad9b8f36648bdb6812fd7b1a46148e577b8a/PowerShell/PowerShell/issues/13873 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c6342d64cdea9b78ef10f21d6b03ad9b8f36648bdb6812fd7b1a46148e577b8a/PowerShell/PowerShell/issues/13873 |
| og:image:alt | Summary of the new feature/enhancement .NET offers a number of specialized dictionary types that all implement the IDictionary interface. [hashtable] (and [ordered] (System.Collections.Specialized.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3c532f4d069d6fbe9b1837450343d1b9e0619a7d5c4ba0b3b64fd8e0bae67c7e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5396ad00d1c6d19097aee7fc4d00a2eb03432c8f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width