I have a file in a powershell script containing data, say:
1
2
3
If I get a random item from that list, and I have the full list, how could I get the index of the item (3 = $List[2]; 1 = $List[0]? The list is not actual numbers, but that was an example. I am using Powershell 5.1 and have no urgent need for speed, as the list is small.