-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Interactive-IntelliSensetab completiontab completionWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
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 reproduce
For PSCustomObject's (and likely others) properties containing characters like spaces and quotes, tab completion automatically quotes and escapes them. As example payload, take:
> $employees = "ID,Employee's name`n1,Alice`n2,Bob"While $employees[0].E<TAB> will correctly produce $employees[0].'Employee''s name', doubling single quote to escape it, it is not done for Where-Object and ForEach-Object.
Expected behavior
> $Employees | % E<TAB>
$Employees | % 'Employee''s name'Actual behavior
> $Employees | % E<TAB>
$Employees | % 'Employee's name'Error details
Pressing enter waits for input due to unclosed quote.Environment data
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
mklement0 and GamilaMuthana
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Interactive-IntelliSensetab completiontab completionWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group