How to generate random objects?

Hi, I’m using java script to generate random objects like power-ups.
So far my code is:

var spawn : GameObject;
var powers : GameObject[];
function start()
{ 
  //the power up items are tagged as powers
  powers = GameObject.FindGameObjectsWithTag("Powers");
  generate();
}
function generate()
{ 
 rand = Random.Range(1f,4f);
  if(rand==1)
  {
   spawn = Instantiate(powers[1], 
						Vector3(10,0,0), 
						Quaternion.identity);
  }
  else if(rand==2)
 {
 spawn = Instantiate(powers[2], 
						Vector3(10,0,0), 
						Quaternion.identity);
 }
 //so on...
 }

But nothing is generated at the position I wanted. Is there something wrong with my code? Any ideas?

Random.Range returns floats, if you use it with floats. Either use integers, or cast the result to integer, or you will never have any of these if statements true.