One reason why this isn't a idea is that variable $a retains it's value (within the assigned scope) until it is reassigned. That may not sound like a big issue, but occasionally PowerShell does something unexpected and it just isn't worth the time troubleshooting to figure something like that out. Consider this function:
function reuse-vars {
$arrayA = 0..3
$arrayB = 10..13
$arrayC = 20..23
foreach ( $a in $arrayA ){
Write-Host "`$a is $a"
Write-Host "`$b is $b"
Write-Host "`$c is $c"
}
foreach ( $b in $arrayB ){
Write-Host "`$a is $a"
Write-Host "`$b is $b"
Write-Host "`$c is $c"
}
foreach ( $c in $arrayC ){
Write-Host "`$a is $a"
Write-Host "`$b is $b"
Write-Host "`$c is $c"
}
}
$a will retain the value from the last foreach iteration until it is reassigned, that includes within nested foreach or if they are in series.
C:\> reuse-vars
$a is 0
$b is
$c is
$a is 1
$b is
$c is
$a is 2
$b is
$c is
$a is 3
$b is
$c is
$a is 3
$b is 10
$c is
$a is 3
$b is 11
$c is
$a is 3
$b is 12
$c is
$a is 3
$b is 13
$c is
$a is 3
$b is 13
$c is 20
$a is 3
$b is 13
$c is 21
$a is 3
$b is 13
$c is 22
$a is 3
$b is 13
$c is 23
It may not matter depending on what you're doing but the possibility for this to cause an issue makes it worthwhile to dream up a different variable name for each foreach (like $b).