Skip to content
This repository was archived by the owner on Feb 4, 2019. It is now read-only.
This repository was archived by the owner on Feb 4, 2019. It is now read-only.

Console command invalid argument parsing when using variables #423

Description

@SemyonL

When I try to invoke console command with a variable followed by double dashes, parser recognises double dashes as decrement operator, but it does not belong to variable, it is just command argument.
E.g.,

PASH C:\> cmd $a --test
The operator '--' can only be used for numbers. The operand is 'System.String'
  +CategoryInfo: InvalidOperation: (test:String) [], RuntimeException
  +FullyQualifiedErrorId: OperatorRequiresNumber

I do not want to decrease $a, I just want to parse it as argument to cmd.
PowerShell will interpret such command correctly and will run console host passing value of $a and --test as arguments to cmd.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions