Do we need to choose a number from 1 to 100?
Do we need to choose five random numbers from 1 to 100?
Do we have PowerShell?
Then we are all set.
First, create an array of numbers from 1 to 100:
$array = (1..100)
Then let PowerShell randomly choose 5 numbers from the array:
Get-Random -InputObject $array -Count 5
And if we need those results in numerical order?
Get-Random -InputObject $array -Count 5 | Sort-Object
No comments:
Post a Comment