-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Steps to reproduce
On PowerShell Core 6.0.4
ConvertTo-Json -InputObject @{ 'abc' = "'def'" }Expected behavior
Windows PowerShell 5.x returns:
{
"abc": "\u0027def\u0027"
}
Actual behavior
PowerShell Core 6.0.4 returns:
{
"abc": "'def'"
}
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.4
PSEdition Core
GitCommitId v6.0.4
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0This would appear to be because the StringEscapeHandling setting is set to Default in
Line 128 in 6671757
| JsonSerializerSettings jsonSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.None, MaxDepth = 1024 }; |
If the StringEscapeHandling setting is set to [Newtonsoft.Json.StringEscapeHandling]::EscapeHtml then the JSON string that is generated matches what is returned by Windows PowerShell.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
