Enumerating through Keys
foreach ($key in $var1.Keys) {
$value = $var1[$key]
# or
$value = $var1.$key
}
Enumerating through Key-Value Pairs
foreach ($keyvaluepair in $var1.GetEnumerator()) {
$key1 = $_.Key1
$val1 = $_.Val1
}