This happens because GPT.INI has BOM and, apparentely, GPMC does not work with UTF-8 with BOM files.
We use the PsIni module to work with GPT.INI, so it should be fixed there, ideally. Currently there is not way to tell Out-IniFile to not write BOM when using UTF-8.
Removing BOM separately proved to be not an easy task, because regular Set-Content returns access violation errors often - possibly it happens because once Out-IniFile updates file's content, DFS-R replicates it and locks the file for that period.
This happens because GPT.INI has BOM and, apparentely, GPMC does not work with UTF-8 with BOM files.
We use the PsIni module to work with GPT.INI, so it should be fixed there, ideally. Currently there is not way to tell Out-IniFile to not write BOM when using UTF-8.
Removing BOM separately proved to be not an easy task, because regular Set-Content returns access violation errors often - possibly it happens because once Out-IniFile updates file's content, DFS-R replicates it and locks the file for that period.