I have a powershell Array object that is programmatically generated, something with arrays inside arrays, inside arrays, sometimes called a "property bag" or a "hashtable", but I think it's natively called an "Array containing Arrays" in the most native powershell terminology.
For example:
@{
Version = '1.0.0'
Name = 'thing'
Revision = 'c3a89cd20e19bb82f41e95e0806edc5b6cfd224e'
Date = '2016-12-09'
Build = '1234'
Contents = @{
"index.html" = "23dd7b993f40bb3ae8848fe104b3b767"
}
}
Generating a function to save only one specific set of contents to a .PSD1 file seems not general enough.
I want to save that exact in-memory Array structure to a PSD1 file. Does any built-in way in Powershell exist to Persist an in-memory variable with the values above? The "opposite function" of Import-PowershellDataFile
. I would have guessed it would be called Export-PowershellDatafile
but no such function seems to exist.
Export-PSData
andWrite-PowerShellHashtable
– RoederExport-Clixml
? – Confectionery[hashtable]
([System.Collections.Hashtable]
)). – Soloist