Powershell ignores Windows region settings for List separator

Welcome Forums General PowerShell Q&A Powershell ignores Windows region settings for List separator

This topic contains 1 reply, has 1 voice, and was last updated by

 
Participant
2 years, 10 months ago.

  • Author
    Posts
  • #33162

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Hi everyone.

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

The topic ‘Powershell ignores Windows region settings for List separator’ is closed to new replies.