Skip to content

Arguments of a command ending with the verbatim argument --% include "". #26217

Open

Description

@kzrnm

Prerequisites

Steps to reproduce

[System.Management.Automation.Language.Parser]::ParseInput("echo --%", [ref]$null, [ref]$null).EndBlock.Statements.PipelineElements.CommandElements

Expected behavior

PS> [System.Management.Automation.Language.Parser]::ParseInput("echo --%", [ref]$null, [ref]$null).EndBlock.Statements.PipelineElements.CommandElements

StringConstantType : BareWord
Value              : echo
StaticType         : System.String
Extent             : echo
Parent             : echo --%

StringConstantType : BareWord
Value              : --%
StaticType         : System.String
Extent             : --%
Parent             : echo --%

Actual behavior

PS> [System.Management.Automation.Language.Parser]::ParseInput("echo --%", [ref]$null, [ref]$null).EndBlock.Statements.PipelineElements.CommandElements

StringConstantType : BareWord
Value              : echo
StaticType         : System.String
Extent             : echo
Parent             : echo --%

StringConstantType : BareWord
Value              : --%
StaticType         : System.String
Extent             : --%
Parent             : echo --%

StringConstantType : BareWord
Value              : 
StaticType         : System.String
Extent             : 
Parent             : echo --%

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.3
PSEdition                      Core
GitCommitId                    7.5.3
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

  1. added
    Needs-Triage
    on Oct 16, 2025
  2. added
    WG-NeedsReview
    WG-Engine
    on Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageWG-EngineWG-NeedsReview

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions