Is there an easy way to deserialize an ordered dictionary object into an indexable type?
<p>Powershell 3.0 has a quick way to created hashtables that maintain their order as well at the cost of a slight memory expenditure.</p>

<p><strong>The Problem:</strong></p>

<pre><code># create ordered hashtable
$a = [ordered]@{}

# populate with 3 key-value pairs
$a['a'] = 15
$a['b'] = 10
$a['c'] = 9

$a
# Name                           Value
# ----                           -----
# a                              15
# b                              10
# c                              9

# get value for key = 'b'
$a['b']
# returns: 10

# get value for indexed last (ordered) item in table: This is desired behaviour
$a[-1]
# returns: 9

# show type of object for variable $a
$a | Get-Member
# returns: TypeName: System.Collections.Specialized.OrderedDictionary
# ...
</code></pre>

<p>All is well so far.</p>

<p>When serializing the object to disk, then deserializing, the object changes from System.Collections.Specialized.OrderedDictionary to <em>Deserialized</em>.System.Collections.Specialized.OrderedDictionary.</p>

<pre><code># serialize to disk
$a | Export-CliXml ./serialized.xml
# deserialize from disk
$d = Import-CliXml ./serialized.xml

# show datatype of deserialized object
# returns: Deserialized.System.Collections.Specialized.OrderedDictionary
# ...

# $d variable is still indexed by key, but not by integer index
$d['b']
# returns: 10

# request the first item in the dictionary by numerical index
$d[0]
# returns: nothing/null, this is undesired behaviour.  AARGH!
</code></pre>

<p>Naturally, I believe the deserialized Ordered Dictionary should behave as the Ordered Dictionary did before it had been persisted to disk, specifically to be able to retrieve hashtable items by numerical index as well as key.</p>

<p>Since that is not currently the case in Powershell, is there a quick way to convert the deserialized object to the base version of the object without doing a foreach on the entire deserialized object?</p>