I'm trying to write a powershell script that picks up from an array 10 random items, list them and then writes which one was picked the most and how many times.
I have this:
for ($num = 1 ; $num -le 10 ; $num++){
$namelist = @(
"Item 1",
"Item 2",
"Item 3",
"Item 4",
"Item 5"
)
Get-Random -InputObject $NameList
}
As result it shows me 10 picks from the list, but everytime I need to count which one was picked the most.
Anyone can help?