Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Looping through an Array and storing Random Numbers

$
0
0

I've tried different ways of storing random numbers into an array but I keep producing an error.  PS doesn't like $a[$x].  Is there another way of looping through an array and dropping in numbers?

Basicly I have something like this,

$x = 0

while ($x -le 10) {

     $a[$x] = Get-random -min 0 -max 9999

     $x++

}


MacrossVF1


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>