Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Hash Tables GetEnumerator method

$
0
0

Worked it out.

Hashtable.GetEnumerator Method Returns an IDictionaryEnumerator that iterates through the Hashtable. When displaying a variable the IDictionaryEnumerator Interface uses MoveNext to advance the enumerator to the next element of the collection. This can be mitigated by using the reset method to set the enumerator to its initial position.
http://msdn.microsoft.com/en-us/library/system.collections.idictionaryenumerator.aspx

$var = $hash.GetEnumerator()
$var | gm #works
$var | gm #errors
$var.Reset()
$var | gm #works

Viewing all articles
Browse latest Browse all 13067

Trending Articles