I have a json data exported using PowerShell but, it could not be read from Hugo templates. Getting an error while building site like “invalid character ‘ï’ looking for beginning of value”. Can any one had this issue before. Please help me out.
While troubleshooting I understood that the json content inside the file is in correct structure but the file could not be read by the Hugo compiler. Below is the json structure exported using PowerShell’s ConvertTo-Json method:
[
{
"x": "text",
"y": 1,
"z": 1,
"a": "001",
"b": "text"
},
{
"x": "text",
"y": 1,
"z": 1,
"a": "001",
"b": "text"
}
]
($DataSet.Tables[0] | select $DataSet.Tables[0].Columns.ColumnName ) | ConvertTo-Json -Depth 2| Out-File "C:\HugoDataExport\1.json " -Encoding utf8 -Force
, This is the code used to genertate json from PowerShell.