Given a list of items in PowerShell, how do I find the index of the current item from within a loop?
For example:
$letters = { \'A\', \'B\', \'C\' }
For PowerShell 3.0 and later, there is one built in :)
foreach ($item in $array) { $array.IndexOf($item) }