Thats a bit vague. So here is my best shot at an answer.
You would want to use the c# Random class, here are the docs
For a simple game, using rectangular collision should be all you need (I assume thats what you are using) - If you want to randomly generate the power-up position, you will want to create a new Vector2 (the powerups position) with the random generator.
You can use the Next function, to pass in a low, and high variable - which you would need to configure the the bounds you wish the powerup to appear.
My advice as a game designer on the other hand, tells me that randomly located power-ups aren't always the go. It makes it harder to control the games flow and balance, and can very easily result in a flawed final product.
So my advice is a hard coded set of possible weapon spawn points - using a random generator to pick one to place.