Skip to content

CLI: when installed as a .NET global tool (dotnet tool), argument parsing is broken #11747

@mklement0

Description

@mklement0

Note:

Steps to reproduce

# NOTE: 
#  * Problem shows if `pwsh` was installed via `dotnet tool --global`
#  * Run from *cmd.exe* or *bash*
pwsh -noprofile -c "write-output 1 \"2 3\""

Expected behavior

1
2 3

That is, the escaped embedded double quotes (\") should be honored, resulting in two outputs, 1, and '2 3'.

This is indeed what happens with a regularly installed version.

Actual behavior

1
2
3

This output suggests that the embedded escaped double quotes (\") were unexpectedly eaten.

Environment data

PowerShell Core 7.0 # as a global .NET tool, all platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Maintainers-Buildspecific to affecting the buildIn-PRIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions