lipkau / PsIni

Work with INI files in PowerShell using hashtables
http://lipkau.github.io/PsIni
MIT License
151 stars 50 forks source link

Please allow duplicate keys #60

Open yuusakuri opened 3 years ago

yuusakuri commented 3 years ago

For example, the php configuration file php.ini allows multiple same keys, such as extension=NAME1, extension=NAME2.

yuusakuri commented 3 years ago

I suggest changing the output to something like this:

@(
    @{
        key = value
    }
    'comment line'
    'comment line'
    @{
        key = value
    }
    # ...
)
PsychoData commented 3 years ago

Hmmm currently - it will add the first Key as a normal "key" and then on finding the second "duplicate" key within the same section - it will convert it to being a list of all the same key. So once they are written out, it would bunch them together again. so

   key = value
# 'comment line'
# 'comment line'
   key = value
# 'comment line' 

would end up like this I believe


# 'comment line'
# 'comment line'
   key = value
   key = value
# 'comment line'