Search

Export-Clixml exports members of a collection, not the collection itself by BigBadJogr

Active

1
0
Sign in
to vote
Type: Bug
ID: 780578
Opened: 3/4/2013 6:43:11 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When exporting an arraylist via Export-Clixml, the resulting xml file only contains the description of members of the arraylist. The collection type is lost during exportation.
Details (expand)
How often does this happen?
Always Happens

Have you seen this problem before in this product?

Yes, this happens in previous released versions
Reproduction Steps
$coll = new-object System.collections.arraylist
$null = $coll.add("firstElement")
$coll | export-clixml $home\test.xml
$coll = import-clixml $home\test.xml
$null = $coll.add("secondElement")
# Causes the following exception:
Method invocation failed because [System.String] doesn't contain a method
named 'add'.
# $coll.gettype() returns String
Expected Results
The imported object should still be a collection.
$coll.add("secondElement") should succeed.
File Attachments
0 attachments
Sign in to post a comment.
Sign in to post a workaround.