How would I go about reading all the key values in a hash table? I'm currently trying the below and it returns nothing.
$dict = @{}
Import-CSV hostname.csv | ForEach-Object {
if ($dict.Keys -contains $_.type) {
$dict[$_.type]+=$_.hostname
} else {
$dict[$_.type] = @($_.hostname)
}
}
$dict.Keys | ForEach-Object {
Write-Host $_hostname
}