Title: A dictionary type that only implements the generic IDictionary interface doesn't support dot notation (property-access syntax) · Issue #17190 · PowerShell/PowerShell · GitHub
Open Graph Title: A dictionary type that only implements the generic IDictionary interface doesn't support dot notation (property-access syntax) · Issue #17190 · PowerShell/PowerShell
X Title: A dictionary type that only implements the generic IDictionary interface doesn't support dot notation (property-access syntax) · Issue #17190 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/17190
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A dictionary type that only implements the generic IDictionary interface doesn't support dot notation (property-access syntax)","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nRelated:\r\n* #15204\r\n\r\n`[Tomlyn.Model.TomlTable]`, from the [Tomlyn package](https://github.com/toml-lang/toml), is an example of a type that implements ``IDictionary`2``, but not also its non-generic counterpart, `IDictionary`.\r\n\r\nSeemingly, this prevents use of dot notation (property-access syntax via the member-access operator) to access the dictionary's entries.\r\n\r\n```powershell\r\n# Determine the package's local installation location.\r\n# If it isn't installed, install it first, in the current user's scope.\r\nwhile (-not ($installDir = (Get-Package -ErrorAction Ignore -ProviderName NuGet Tomlyn).Source)) {\r\n $null = Install-Package -Scope CurrentUser -ErrorAction Stop -ProviderName NuGet Tomlyn\r\n}\r\n\r\n# Load the package's assembly into the session.\r\nAdd-Type -ErrorAction Stop -LiteralPath (Join-Path $installDir '../lib/netstandard2.0/Tomlyn.dll')\r\n\r\n# Define a sample TOML string to parse.\r\n$tomlStr = @'\r\nfoo = \"bar\"\r\n'@\r\n\r\n# Parse the TOML string into an object mod)el (nested dictionaries).\r\n$tomlTable = [Tomlyn.Toml]::ToModel($tomlStr)\r\n\r\n# Output the global section's 'foo' value,\r\n# first via an indexer, then via dot notation.\r\n$tomlTable['foo'], $tomlTable.foo | ForEach-Object { \"[$_]\" }\r\n```\r\n\r\n### Expected behavior\r\n\r\n```console\r\n[bar]\r\n[bar]\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\n[bar]\r\n[]\r\n```\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n```powershell\r\nPowerShell Core 7.3.0-preview.3\r\n```\r\n\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2022-04-25T02:06:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/17190/PowerShell/issues/17190"}
| 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:489d60fd-e1a9-161d-3ef4-1f1b023e7046 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B072:172D3F:2569F74:32C2278:6A547CFD |
| html-safe-nonce | fa39a4af9d972a260771f89c24510ac4fb05f5fecad5c16f69cf7587e528b024 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDcyOjE3MkQzRjoyNTY5Rjc0OjMyQzIyNzg6NkE1NDdDRkQiLCJ2aXNpdG9yX2lkIjoiMzc5NzY1MDk2NDQwNTg0NTI0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 92c442fc124d0126b1e6c7ecabf3794b70bdd95544da95e50fb12bbf7b1ee653 |
| hovercard-subject-tag | issue:1213859154 |
| 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/17190/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6a218219d74564cadccd5c16655324140dd1abe1b938a87713eda167acd15f6e/PowerShell/PowerShell/issues/17190 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6a218219d74564cadccd5c16655324140dd1abe1b938a87713eda167acd15f6e/PowerShell/PowerShell/issues/17190 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| 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 | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width