diff --git a/src/Automation/Automation/ChangeLog.md b/src/Automation/Automation/ChangeLog.md index ab5b36fed5a8..7b647cb94bfa 100644 --- a/src/Automation/Automation/ChangeLog.md +++ b/src/Automation/Automation/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed the issue that string cannot be serialized correctly. [#14215] * Added Support for Python3 Runbook Type ## Version 1.4.3 diff --git a/src/Automation/Automation/Common/PowershellJsonConverter.cs b/src/Automation/Automation/Common/PowershellJsonConverter.cs index 1504b514c58d..8150c8e37027 100644 --- a/src/Automation/Automation/Common/PowershellJsonConverter.cs +++ b/src/Automation/Automation/Common/PowershellJsonConverter.cs @@ -36,7 +36,7 @@ public static string Serialize(object inputObject) } if (inputObject is string @str) { - return str.Trim(); + return JsonConvert.SerializeObject(str.Trim()); } else if (inputObject is object[] @objectArray) {