"An empty pipe element is not allowed" after curly braces #3187

Open
opened 2026-01-30 23:15:12 +00:00 by claunia · 0 comments
Owner

Originally created by @schneidr on GitHub (Aug 6, 2019).

Environment

Windows build number: 10.0.18362.239
Windows Terminal version (if applicable): 0.3.2171.0

Any other software?

Steps to reproduce

Paste a multiline PowerShell cmd that has a pipe symbol after curly braces in a powershell terminal.

Example:

Get-Volume |
Where-Object {
	$_.DriveLetter.length -gt 0
} |
Select DriveLetter,Size

Expected behavior

The commands get executed. It works in regular PowerShell:

PS C:\Users\geschnei> Get-Volume |
>> Where-Object {
>> $_.DriveLetter.length -gt 0
>> } |
>> Select DriveLetter,Size

DriveLetter         Size
-----------         ----
          C 254524760064

Actual behavior

You get an error message:

At line:2 char:47 + Where-Object { $_.DriveLetter.length -gt 0 } | + ~ An empty pipe element is not allowed. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : EmptyPipeElement

Originally created by @schneidr on GitHub (Aug 6, 2019). # Environment ```none Windows build number: 10.0.18362.239 Windows Terminal version (if applicable): 0.3.2171.0 Any other software? ``` # Steps to reproduce Paste a multiline PowerShell cmd that has a pipe symbol after curly braces in a powershell terminal. Example: Get-Volume | Where-Object { $_.DriveLetter.length -gt 0 } | Select DriveLetter,Size # Expected behavior The commands get executed. It works in regular PowerShell: PS C:\Users\geschnei> Get-Volume | >> Where-Object { >> $_.DriveLetter.length -gt 0 >> } | >> Select DriveLetter,Size DriveLetter Size ----------- ---- C 254524760064 # Actual behavior You get an error message: > At line:2 char:47 + Where-Object { $_.DriveLetter.length -gt 0 } | + ~ An empty pipe element is not allowed. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : EmptyPipeElement
claunia added the Needs-TriageResolution-Duplicate labels 2026-01-30 23:15:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3187