SyntaxFix
Write A Post
Hire A Developer
Questions
Here is another quick way, just using the key as an index into the hash table to get the value:
$hash = @{ 'a' = 1; 'b' = 2; 'c' = 3 }; foreach($key in $hash.keys) { Write-Host ("Key = " + $key + " and Value = " + $hash[$key]); }