Save hash table in PowerShell object notation (PSON)
问题 The question Loading a PowerShell hashtable from a file? documents how to load a file that contains a hashtable in PSON format into a variable, but how does one save a hashtable to a file in PSON format? Hashtable: @{ \"name\" = \"report 0\" \"parameters\" = @( @{\"name\" = \"parameter 0\"; \"default\" = 1; \"values\"=1,2,3,4}, @{\"name\" = \"parameter 1\"; \"default\" = \'A\'; \"values\" = \'A\',\'B\',\'C\'} ) } 回答1: Try the *-CliXml cmdlets. To save the object: @{ "name" = "report 0"