0 votes
1 view
in Others by (2.5k points)

The following works as expected:

$values = @( ("x", "y"), ("k", "p") )
foreach($value in $values)
{
  write-host "Value 0 =" $value[0]
  write-host "Value 1 =" $value[1]
}

which results(1) in:

Value 0 = x
Value 1 = y
Value 0 = k
Value 1 = p

1 Answer

0 votes
by (7.2k points)

To solve this kind of error in TABLEAU you'll need to use the comma trick (the array operator) to get your  result:

$values = @( ,("x", "y") ) foreach($value in $values) { write-host "Value 0 =" $value[0] write-host "Value 1 =" $value[1] }

Result:

Value 0 = x Value 1 = y

Actually all you need is this:

$values = ,("x", "y")

Related questions

0 votes
1 answer
0 votes
1 answer
asked Mar 21 in Java by Jake (6.8k points)
0 votes
2 answers
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...