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

Console command invalid argument parsing when using variables #423

Open
SemyonL opened this issue Jul 5, 2016 · 1 comment
Open

Console command invalid argument parsing when using variables #423

SemyonL opened this issue Jul 5, 2016 · 1 comment

Comments

@SemyonL
Copy link

SemyonL commented Jul 5, 2016

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.

@ygra
Copy link
Contributor

ygra commented Jul 5, 2016

Looks like our distinction between command and expression mode fails here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants