Types/OpenPackage.Part/WriteClixml.ps1

<#
.SYNOPSIS
    Write Part Content as Clixml
.DESCRIPTION
    Write Open Package Part Content as Clixml
#>

[Reflection.AssemblyMetadata('FilePattern', '\.(?>clixml|clix)?$')]
param(
# The object to write.
[Alias('Input','Content','Text')]
[PSObject]
$InputObject,

<#

Any options used to write the object

Supported Options:

|Option|Description|
|-|-|
|Depth|The serialization depth|
|Encoding|The text encoding|
|Stream|Optional destination stream|

#>

[Collections.IDictionary]
$Option = [Ordered]@{}
)
if (-not $this.WriteText) { return }

if (-not $option.Depth) {
    $option.Depth = $FormatEnumerationLimit * 2
}

$this.WriteText([Management.Automation.PSSerializer]::Serialize($InputObject, $option.Depth), $option)