Skip to content

Document ConvertTo-CliXml and ConvertFrom-CliXml cmdlets #10773

@ArmaanMcleod

Description

@ArmaanMcleod

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

We need to document ConvertTo-CliXml and ConvertFrom-CliXml cmdlets. These cmdlets were requested so we can serialize/deserialize CliXML from memory without needing to read/write from file system,

Details

Parameter Sets

ConvertTo-CliXml [-InputObject] <psobject> [-Depth <int>] [<CommonParameters>]

ConvertFrom-CliXml [-InputObject] <string> [<CommonParameters>]

Example 1

Serialize to CLI XML string and deserialize to CLI XML object in memory,

> $cliXmlString = [pscustomobject]@{'hello' = 1} | ConvertTo-CliXML
> $cliXmlString
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
  <Obj RefId="0">
    <TN RefId="0">
      <T>System.Management.Automation.PSCustomObject</T>
      <T>System.Object</T>
    </TN>
    <MS>
      <I32 N="hello">1</I32>
    </MS>
  </Obj>
</Objs>
> $cliXmlString | ConvertFrom-CliXml

hello
-----
    1

Articles

  • reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md
  • reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md

Related Source Pull Requests

Related Source Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-doc-ideaIssue - request for new content

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions