FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Document the three return shapes of PSSerializer.Deserialize by esidorenko-sl · Pull Request #27889 · PowerShell/PowerShell · GitHub

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,13 @@ internal static string Serialize(IList<object> source, int depth, bool enumerate
/// <summary>
/// Deserializes PowerShell CliXml into an object.
/// </summary>
/// <param name="source">The CliXml the represents the object to deserialize.</param>
/// <returns>An object that represents the serialized content.</returns>
/// <param name="source">The CliXml that represents the object to deserialize.</param>
/// <returns>
/// The shape of the returned value depends on how many objects the CliXml contains:
/// <see langword="null"/> if it contains no objects, the single deserialized object if it
/// contains exactly one, or an <see cref="object"/> array if it contains more than one.
/// Use <see cref="DeserializeAsList(string)"/> instead if a consistent return type is needed.
/// </returns>
public static object Deserialize(string source)
{
object[] results = DeserializeAsList(source);
Expand All @@ -188,8 +193,8 @@ public static object Deserialize(string source)
/// <summary>
/// Deserializes PowerShell CliXml into a list of objects.
/// </summary>
/// <param name="source">The CliXml the represents the object to deserialize.</param>
/// <returns>An object array represents the serialized content.</returns>
/// <param name="source">The CliXml that represents the object to deserialize.</param>
/// <returns>An object array that represents the serialized content.</returns>
public static object[] DeserializeAsList(string source)
{
List<object> results = new List<object>();
Expand Down

Back | FazBrowse Home | New Git URL