I'm having trouble getting any file edited with PsIni to have any value read using GetPrivateProfileString. GetPrivateProfileString always return the default value in the call. After this happens, even if I manually edit the ini file in something like notepad or ultraedit to revert back to the previous value, the calls to GetPrivateProfileString still can't read this value.
Looks like using -Encoding ascii paired with Out-IniFile resolved it. I guess GetPrivateProfileStringdoes not like UTF8 encoded INI files. Today I learned :)
I'm having trouble getting any file edited with PsIni to have any value read using GetPrivateProfileString. GetPrivateProfileString always return the default value in the call. After this happens, even if I manually edit the ini file in something like notepad or ultraedit to revert back to the previous value, the calls to GetPrivateProfileString still can't read this value.
Create file at 'C:\Test.ini' and put in contents:
Update ini file:
Demo script in linqpad: