Closed jkubecki closed 2 years ago
I'm not sure that I follow what you expected to happen, but perhaps I need to document this better.
The Export
command follows PowerShell's usual semantics for export: it takes an input object and exports that entire object, overwriting any previous content in the destination. It is not an Update
and that is why there is an Update-Metadata
and Update-Object
.
Essentially, Import-Configuration and Export-Configuration always work with the full Configuration object, and the Export
command is not designed to allow you to export a subset, nor only the values the user has changed.
If you want to update a single value, you should either:
Import-Metadata
and add or set the value, then Export-Metadata
Update-Metadata
(note: this currently can't add values)
Issue description
When using a nested Hashtable with more than 1 value, using
Export-Configuration
to save the values individually overwrites the previous values for the nested Hashtable.Sorry if this format is not good for reporting this bug - tried to be as detailed as possible and provide test/example scenario files.
Steps to reproduce the issue
What's the expected result?
The end of the output to show BOTH values having been overridden in User Configuration file, and Final Config to reflect BOTH overrides:
What's the actual result?
The end of the output shows only the MOST RECENT value having been overridden in User Configuration file, and Final Config only reflects the MOST RECENT override: