I am trying to convert a hashtable back to key-value pair in an efficient way. Currently I am using this:
$kv = ""
$hash.GetEnumerator() | ForEach {
$kv += "$($_.Name)=$($_.Value)"
}
Isn't there any way to directly convert hash table to key value pairs, or I mean string data. There is ConvertFrom-StringData
to convert key value pairs to hash table. Isn't there any way to do the opposite, convert hash tables to key value pairs directly?
E.G(Key-Value pair)
a=1
b=2
c=3