count occurrence in array powershell code example
Example 1: count specific number in array powershell
$grades = @($g1, $g2, $g3, $g4, $g5, $g6)
$countCredit = for($x=0; $grades -gt 50 ; $x++) { $x.count }
Write-Host "Credits Earned: " $countCredit
Example 2: count specific number in array powershell
$countCredit = for($x=$grade.count; $x -gt 50 ; $x++) { $grades[$x] }
Write-Host "Credits Earned: " $countCredit