Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Select Two Random Numbers from 20 Possibilities

$
0
0

Summary: Use Windows PowerShell to select two random numbers from twenty possible numbers.

Hey, Scripting Guy! Question How can I use Windows PowerShell to select two of twenty attendees at user group to receive prizes?

Hey, Scripting Guy! Answer Create a range of input numbers with the Get-Random cmdlet, then use the –Count parameter to retrieve
           two random numbers:

Get-Random -InputObject (1..20) -Count 2


Viewing all articles
Browse latest Browse all 3333

Trending Articles



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