Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


Is giving the following output:

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

What gives?


share|improve this question
up vote 0 down vote accepted


Should have been using

test 1 2 3

to invoke the function.

Thanks anyway!


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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