Don't use an array, use a hash instead:
$hash = @{Austria='AU'; Brazil='BZ'}
$CountryNames = 'Austria','Brazil','Canada'
$CountryNames |
ForEach-Object{
$CC = $hash[$_]
Write-Host "Country name '$_' has the code '$CC'" # doesn't report an error, just an empty country code
}
# -- or
$CountryNames |
ForEach-Object{
if($hash.ContainsKey($_)){
$CC = $hash[$_]
Write-Host "Country name '$_' has the code '$CC'"
}
Else{
Write-Host "Country name '$_' is not in lookup table"
}
}