You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an ini file with the following section:
[RunMdl:Parameters]
Model=$1
Result=$2
Keys=$3
Extras=$4
Environment=$5
MetaData=$6
DBB_XMLInput=$7
DBB_XMLOutput=$8
which gets correctly imported:
but in the output that section is broken:
[RunMdl:Parameters]
$3 =
using this command: Export-Ini -InputObject $ini -Filepath "somepath" -encoding ascii
Doesn't matter which encoding i use, same issue. I'm adding a line to a completely different section[Configuration], so its not what I'm doing that that's causing this.
Steps To Reproduce
import the file using import-ini
add section using += $iniAdd
export using export-ini
Go to '...'
Click on '....'
Scroll down to '....'
See error
Expected behaviors
I would expect this section to come out unmodified.
Screenshots
Your Environment
Psini v4, powershell v5.
Get-Module PSIni -ListAvailable | Select Name, Version
$PSVersionTable
Having the exact same issue - the section I change something in - gets corrupted in the Output - I thought this may be as the original file is Unicode (LE) but I can't, in anyway possible, find a way to use the new -Encoding parameter either:
PS C:\Users\WDAGUtilityAccount\Desktop>Import-Ini-Encoding Unicode
Import-Ini : Cannot process argument transformation on parameter 'Encoding'. Cannot convert t
he "Unicode" value of type "System.String" to type "System.Text.Encoding".
At line:1 char:22+Import-Ini-Encoding Unicode
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Import-Ini], ParameterBindingArgumentTransfo
rmationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Import-Ini
PS C:\Users\WDAGUtilityAccount\Desktop>Import-Ini-Encoding [System.Text.Encoding]::UTF8
Import-Ini : Cannot process argument transformation on parameter 'Encoding'. Cannot convert t
he "[System.Text.Encoding]::UTF8" value of type "System.String" to type "System.Text.Encoding".
At line:1 char:22+Import-Ini-Encoding [System.Text.Encoding]::UTF8
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Import-Ini], ParameterBindingArgumentTransfo
rmationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Import-Ini
Activity
[-]section being removed in the output[/-][+]section being corrupted in the output[/+]Fixed the enumeration of keys
Fixed the enumeration of keys (#125)
lipkau commentedon May 27, 2025
Fixed.
I tried releasing the fix as v4.0.1 already, but it didn't work:
https://github.com/lipkau/PSIni/actions/runs/15285438998/job/42994531082
I will released it as soon as possible, tho.
jgriffiths014 commentedon Jun 25, 2025
any idea when this will be released?
ThaDaVos commentedon Jul 16, 2025
Having the exact same issue - the section I change something in - gets corrupted in the Output - I thought this may be as the original file is Unicode (LE) but I can't, in anyway possible, find a way to use the new
-Encodingparameter either: