-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Summary of the new feature/enhancement
Get-Random currently requires you to specify a -Count argument in order to extract a random subset from an input collection.
Sometimes you want to shuffle an input collection, i.e. to return all input objects, in randomized order, and it would be nice to be able to express that intent directly, without having to provide a -Count (which may not even be known; you can work around that with -Count ([int]::MaxValue), but that is awkward).
To that end, a new -Shuffle parameter could be introduced:
# WISHFUL THINKING - sample output.
PS> 1..5 | Get-Random -Shuffle
4
2
5
3
1
ThomasNieto, vexx32 and eugenesmlv
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module