Any idea why my script is acting funny?

I am passing it some arguments, but it doesn't seem to be assigning them to the correct variables. E.g.

function test($a, $b, $c){

    write-host "A: " $a
    write-host "B: " $b
    write-host "C: " $c

    $sum = $a + $b + $c

    write-host "The sum is: " $sum
}

test(1,2,3)

Is giving the following output:

A:  1 2 3
B: 
C: 
The sum is:  1 2 3  

What gives?

Ben

link|improve this question

77% accept rate
feedback

1 Answer

up vote 0 down vote accepted

Dammit.

Should have been using

test 1 2 3

to invoke the function.

Thanks anyway!

Ben

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.