-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ConvertTo-Json string escaped handling differs between PS and PSCore #7693
Copy link
Copy link
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
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
Steps to reproduce
On PowerShell Core 6.0.4
Expected behavior
Windows PowerShell 5.x returns:
Actual behavior
PowerShell Core 6.0.4 returns:
Environment data
This would appear to be because the
StringEscapeHandlingsetting is set toDefaultinPowerShell/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs
Line 128 in 6671757
If the
StringEscapeHandlingsetting is set to[Newtonsoft.Json.StringEscapeHandling]::EscapeHtmlthen the JSON string that is generated matches what is returned by Windows PowerShell.