Forum Discussion

__Martin__'s avatar
__Martin__
Copper Contributor
Aug 17, 2020

Why does my generated JSON have too many "\\"?

Dear Community I have a Powershell Script which generates a JSON file with data in it.  I have a problem with this file though. It generates double the amount of "\\"!   Do you know how I could s...
  • Manfred101's avatar
    Manfred101
    Aug 17, 2020

    __Martin__ 

    Hello Martin,

    What you are doing is quit dangerous. You are breaking your JSON file and will receive an error when you import your JSON file. A backslash is reserved by the JSON and so when you want to use a backslash inside your data you NEED to escape your backslash whit a backslash. Doesn’t look to well but it has to be that way. The convertfrom-json cmdlet will deal whit the double backslash.

    Grtz, Manfred

Resources