Powershell ignores Windows region settings for List separator

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Paps Sale Paps Sale 1 year, 5 months ago.

  • Author
    Posts
  • #33162
    Profile photo of Paps Sale
    Paps Sale
    Participant

    While running on a Windows Server 2012 R2, I have the following problem with Powershell:

    When I run a script to create a CSV (by running Excel com objects), it creates the CSV with "," separators, therefore ignoring the Windows region settings for List separator, which is set as ";".

    I used the following code to get the current List separator:
    "(Get-Culture).TextInfo.ListSeparator"
    and the result is ","

    PS: This issue has been partially mentioned in my other post "Excel "Save as CSV" delimiter incorrect", however I saw the need to create a separate post from it.

  • #33171
    Profile photo of Paps Sale
    Paps Sale
    Participant

    Hi everyone.

    Finally resolved it. I just needed to restart my server for the Windows region settings to effect Powershell as well.

You must be logged in to reply to this topic.