Title: `Export-Csv` / `ConvertTo-Csv`: Stringification of array-valued property values depends on whether they happen to be `[psobject]`-wrapped · Issue #20450 · PowerShell/PowerShell · GitHub
Open Graph Title: `Export-Csv` / `ConvertTo-Csv`: Stringification of array-valued property values depends on whether they happen to be `[psobject]`-wrapped · Issue #20450 · PowerShell/PowerShell
X Title: `Export-Csv` / `ConvertTo-Csv`: Stringification of array-valued property values depends on whether they happen to be `[psobject]`-wrapped · Issue #20450 · 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/20450
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Export-Csv` / `ConvertTo-Csv`: Stringification of array-valued property values depends on whether they happen to be `[psobject]`-wrapped","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://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nNote:\r\n* Arguably, the stringification of an incidentally `[psobject]`-wrapped value makes _more_ sense.\r\n * See also: #20383\r\n* Ultimately, this is yet another manifestation of #5579 in that the way in which the calculated property's value is created involves an incidental (and otherwise invisible) `[psobject]` wrapper.\r\n\r\n```powershell\r\n\u0026 {\r\n [psobject]::new() | Select-Object @{Name = \"Groups\"; Expression = { 'a', 'b', 'c' } } \r\n [pscustomobject] @{ Groups = 'a', 'b', 'c' }\r\n} | ConvertTo-Csv\r\n```\r\n\r\n\r\n### Expected behavior\r\n\r\n```console\r\n\"Groups\"\r\n\"a b c\"\r\n\"a b c\"\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\n\"Groups\"\r\n\"a b c\"\r\n\"System.Object[]\"\r\n```\r\n\r\nThat is, without the incidental `[psobject]` wrapper, simple `.ToString()` stringification was applied.\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 7.4.0-preview.6\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":"2023-10-06T22:00:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/20450/PowerShell/issues/20450"}
| 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:ff47b2bf-c67b-36c3-1b2a-4c7f0e3024c3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B34A:1F2D8B:C176E:107ADE:6A5CAF11 |
| html-safe-nonce | 8d5b6742afaa6a974ea7316195591e98ce8675c08e8a2c1211ee84b3463f573c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzRBOjFGMkQ4QjpDMTc2RToxMDdBREU6NkE1Q0FGMTEiLCJ2aXNpdG9yX2lkIjoiNjE5NzQ0MTIyOTI1OTMyMTEwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f983dfb18217656bc70da9691b09b6d724c7761e2fa0a259b6a3b750a92c994f |
| hovercard-subject-tag | issue:1930981041 |
| 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/20450/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6bae30199e245e68a187514b5b42319277b0623d04761748eda7066348bbeecd/PowerShell/PowerShell/issues/20450 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6bae30199e245e68a187514b5b42319277b0623d04761748eda7066348bbeecd/PowerShell/PowerShell/issues/20450 |
| 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 | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width