Introducing Darth Enumerator, PowerShell TIE Fighter |e| Operator(tellingmachine.com)
submitted by
Klaus(755) 3 years, 1 month ago
Starting this project, I assumed that the distinction between an array and a Hashtable in PowerShell is the implementation of the IEnumerable interface. Now I know that there are two kinds of IEnumerables: There is one kind that PowerShell converts into Arrays before processing it in a pipeline for example an ArrayList. And another kind like a SortedList or a HashTable that get passed to the pipeline as scalar objects. My assumption was wrong and now there is some room for speculations. I wonder whether adding an extension method like ToArray() to the .NET Hashtable class, would let me pipe a Hashtable in PowerShell as Array of Dictionary Objects.
|category: Tips & Tricks
|Views: 7
tags:
Tips another
Everyones tags:
Your Tags: