Skip to content

Commit 4085b32

Browse files
chawyehsubrian6932
authored andcommitted
fix(json): Serialize jsonpath return (ScoopInstaller#5921)
1 parent a9752ed commit 4085b32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/json.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function json_path([String] $json, [String] $jsonpath, [Hashtable] $substitution
116116
# Convert first value to string
117117
$result = $result.ToString()
118118
} else {
119-
$result = "$([String]::Join('\n', $result))"
119+
$result = [Newtonsoft.Json.JsonConvert]::SerializeObject($result)
120120
}
121121
return $result
122122
} catch [Exception] {

0 commit comments

Comments
 (0)