I\'m parsing simple (no sections) INI file in PowerShell. Here code I\'ve came up with, is there any way to simplify it?
convertfrom-stringdata -StringData (
Don Jones almost had it right. Try:
ConvertFrom-StringData((Get-Content .\deploy.ini) -join "`n")
-join converts the Object[] into a single string, with each item in the array separated by a newline char. ConvertFrom-StringData then parses the string into key/value pairs.
-join
ConvertFrom-StringData