Title: Make [pscustomobject] casts support *arrays* of hashtables · Issue #13838 · PowerShell/PowerShell · GitHub
Open Graph Title: Make [pscustomobject] casts support *arrays* of hashtables · Issue #13838 · PowerShell/PowerShell
X Title: Make [pscustomobject] casts support *arrays* of hashtables · Issue #13838 · PowerShell/PowerShell
Description: Summary of the new feature/enhancement Just like this works: # OK, accepts an *array* of strings to cast. [int[]] ('1', '2').GetType.FullName so should this: # !! BROKEN - *array* of hashtables isn't meaningfully supported - and is a vir...
Open Graph Description: Summary of the new feature/enhancement Just like this works: # OK, accepts an *array* of strings to cast. [int[]] ('1', '2').GetType.FullName so should this: # !! BROKEN - *array* of hashtables isn...
X Description: Summary of the new feature/enhancement Just like this works: # OK, accepts an *array* of strings to cast. [int[]] ('1', '2').GetType.FullName so should this: # !! BROKEN - *array* o...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13838
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make [pscustomobject] casts support *arrays* of hashtables","articleBody":"## Summary of the new feature/enhancement\r\n\r\nJust like this works:\r\n\r\n```powershell\r\n# OK, accepts an *array* of strings to cast.\r\n[int[]] ('1', '2').GetType.FullName\r\n```\r\n\r\nso should this:\r\n\r\n```powershell\r\n# !! BROKEN - *array* of hashtables isn't meaningfully supported - and is a virtual no-op.\r\n[pscustomobject[]] (@{ prop = 1 }, @{ prop = 2 })\r\n```\r\n\r\nThat is, the behavior of an _array_ cast should be analogous to a scalar one, as it _mostly_ already is.\r\n\r\nIn the case of `[pscustomobject[]]`, however, the cast is virtually ignored (in reality, the input array is uselessly wrapped in a largely invisible `[psobject]` instance, as explained in #13836):\r\n\r\n```powershell\r\n# !! BROKEN - no conversion takes place.\r\nPS> [pscustomobject[]] (@{ prop = 1 }, @{ prop = 2 }) | % { $_.GetType().FullName }\r\nSystem.Collections.Hashtable\r\nSystem.Collections.Hashtable\r\n```\r\n\r\n\r\nInstead, the hashtables should individually be converted to `[pscustomobject]`s and a strongly typed `[pscustomobject[]]` array should be constructed from them.\r\n\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-10-22T20:19:28Z","url":"https://github.com/PowerShell/PowerShell/issues/13838"}
| 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:6e9c2d06-9a0e-7650-230c-c27363f24a9f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF26:2C529F:DE0FA1:13DA409:6AFDB3F7 |
| html-safe-nonce | 220f7184d79e7391175ac81b7c85024e419f2fbd8195c7b59705f4e8230cc9fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjI2OjJDNTI5RjpERTBGQTE6MTNEQTQwOTo2QUZEQjNGNyIsInZpc2l0b3JfaWQiOiI0Mjc2MDk0MjUzNzE4NjgwNTY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f9d2f7fc4eae4dd707ed5df3b4e886e24c36093edf1ec3c213a66e87ef5420d9 |
| hovercard-subject-tag | issue:727694150 |
| 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/13838/issue_layout |
| twitter:image | https://opengraph.githubassets.com/02f3838b3788fc960c27d6ddd1f6cd0310329f1807fc013787d310c5b042f890/PowerShell/PowerShell/issues/13838 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/02f3838b3788fc960c27d6ddd1f6cd0310329f1807fc013787d310c5b042f890/PowerShell/PowerShell/issues/13838 |
| og:image:alt | Summary of the new feature/enhancement Just like this works: # OK, accepts an *array* of strings to cast. [int[]] ('1', '2').GetType.FullName so should this: # !! BROKEN - *array* of hashtables isn... |
| 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