The operator (@) should do what you need. First, consider this simple function:
function foo($a, $b) { "===> $a + $b" }
A call with explicit arguments gives what you expect:
foo "hello" "world" ===> hello + world
Now put these two values ββin an array; passing through a normal array gives incorrect results, as you noticed:
$myParams = "hello", "world" foo $myParams ===> hello world +
But instead, split the array and get the desired result:
foo @myParams ===> hello + world
This works for both scripts and functions. Returning to your script, here is the result:
.\internal @myParams [paramA, hello] [paramB, world]
Finally, this will work for an arbitrary number of parameters, so you need to know a priori knowledge about them.
source share