lipkau / PsIni

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

If values are double in one section the Write operation add mistakes #52

Open Harald162 opened 4 years ago

Harald162 commented 4 years ago

For scripting VPN connections for MS Always On VPN we have to modify %AppData%\Microsoft\Network\Connections\PBK\rasphone.ini. This file contains multiple entries where values are double or even more often. Before DEVICE=vpn DEVICE=vpn After DEVICE=System.Collections.ArrayList vpn DEVICE=vpn The first entry will always get this "System.Collections.ArrayList" at first. This will come at every first entry where the same value appears multiple times. I'm working with $Content = Get-IniContent and $NewContent | Out-IniFile ... This behavoiur can be reproduced.