I have a hashtable that is populated over the course of filling out a form. When I try to use GetEnumerator on it within a function in the main script, it simply never returns anything. But if I pipe it that returns the contents. The hashtable splats fine to the command later on in the function. I really don’t understand what is going on.
$Parameters | Out-String | Write-Host
$Parameters.GetEnumerator() | ForEach-Object {
Write-Output "Key = $($_.key) , Value = $($_.Value)"
}
Results:
Name Value
---- -----
Division DM FVN ACT
Path OU=MBUs,DC=contoso,DC=local