8000 section being corrupted in the output · Issue #124 · lipkau/PSIni · GitHub
[go: up one dir, main page]

Skip to content

section being corrupted in the output #124

Closed

Description

@jgriffiths014

Description

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:

Image

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

  1. import the file using import-ini
  2. add section using += $iniAdd
  3. export using export-ini
  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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

Possible Solution

Activity

  1. changed the title [-]section being removed in the output[/-] [+]section being corrupted in the output[/+] on May 21, 2025
  2. added a commit that references this issue on May 27, 2025
    66b6bb4
  3. added a commit that references this issue on May 27, 2025
    83bcec6
  4. lipkau commented on May 27, 2025

    @lipkau
    Owner

    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.

  5. jgriffiths014 commented on Jun 25, 2025

    @jgriffiths014
    Author

    any idea when this will be released?

  6. ThaDaVos commented on Jul 16, 2025

    @ThaDaVos

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0