Title: Tab completion for Where-Object and Foreach-Object does not escape single quotes in property names · Issue #24493 · PowerShell/PowerShell · GitHub
Open Graph Title: Tab completion for Where-Object and Foreach-Object does not escape single quotes in property names · Issue #24493 · PowerShell/PowerShell
X Title: Tab completion for Where-Object and Foreach-Object does not escape single quotes in property names · Issue #24493 · 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/24493
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tab completion for Where-Object and Foreach-Object does not escape single quotes in property names","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\nFor PSCustomObject's (and likely others) properties containing characters like spaces and quotes, tab completion automatically quotes and escapes them. As example payload, take:\r\n\r\n```pwsh\r\n\u003e $employees = \"ID,Employee's name`n1,Alice`n2,Bob\"\r\n```\r\n\r\nWhile `$employees[0].E\u003cTAB\u003e` will correctly produce `$employees[0].'Employee''s name'`, doubling single quote to escape it, it is not done for `Where-Object` and `ForEach-Object`. \n\n### Expected behavior\n\n```console\n\u003e $Employees | % E\u003cTAB\u003e\r\n$Employees | % 'Employee''s name'\n```\n\n\n### Actual behavior\n\n```console\n\u003e $Employees | % E\u003cTAB\u003e\r\n$Employees | % 'Employee's name'\n```\n\n\n### Error details\n\n```console\nPressing enter waits for input due to unclosed quote.\n```\n\n\n### Environment data\n\n```powershell\nName Value\r\n---- -----\r\nPSVersion 7.4.5\r\nPSEdition Core\r\nGitCommitId 7.4.5\r\nOS Microsoft Windows 10.0.22631\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/dkaszews","@type":"Person","name":"dkaszews"},"datePublished":"2024-10-25T12:05:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/24493/PowerShell/issues/24493"}
| 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:de41f171-43cb-934d-2d5a-653e60d76b36 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A23E:32F6:DFA4F4:12B41BE:6A59A8DE |
| html-safe-nonce | 1c83e05854d0d9fc7c6363a5342a0264d4360c16d9e5c386438e605c7f825a6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjNFOjMyRjY6REZBNEY0OjEyQjQxQkU6NkE1OUE4REUiLCJ2aXNpdG9yX2lkIjoiNzkwOTA2NDk5Nzg2OTc1NDU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ac4facbff59d054870ca0cb801426ac397a1c86e738b3b35e63005be7e43b140 |
| hovercard-subject-tag | issue:2613922396 |
| 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/24493/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7382b991900da5bce3b4696c4ab3a138b3ffb7102a6c01409194e965ea9e0f53/PowerShell/PowerShell/issues/24493 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7382b991900da5bce3b4696c4ab3a138b3ffb7102a6c01409194e965ea9e0f53/PowerShell/PowerShell/issues/24493 |
| 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 | dkaszews |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 | 0b971869dd75eec26500a9de7e85b8137c6bf0f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width