Randomize Lists of Numbers

by Nov 28, 2014

All PowerShell versions

This line will take a list of numbers and randomize their order:

Get-Random -InputObject 1, 2, 3, 5, 8, 13 -Count ([int]::MaxValue)

Piping works too, but it's slower:

1, 2, 3, 5, 8, 13 | Sort-Object -Property { Get-Random }

Twitter This Tip! ReTweet this Tip!