How to Pick Random Items from an Array in PowerShell
To pick random items from an array in PowerShell, pipe the array to Get-Random. Add -Count to get several different items at once: That covers most scripts. Below I’ll show repeats, shuffling, repeatable picks, weighted choices, and the places where Windows PowerShell 5.1 behaves differently from PowerShell 7. How do I pick a random item … Read more