< Back

ConvertTo-PSFClixml

Sun Jan 19, 2020 6:39 pm

NAME ConvertTo-PSFClixml



SYNOPSIS

Converts an input object into a serialized string or byte array.





SYNTAX

ConvertTo-PSFClixml [[-Depth] <Int32>] [[-InputObject] <Object>] [[-Style] {String | Byte}] [-NoCompression]

[<CommonParameters>]





DESCRIPTION

Converts an input object into a serialized string or byte array.

Works analogous to Export-PSFClixml, only it does not require being written to file.





PARAMETERS

-Depth <Int32>

Specifies how many levels of contained objects are included in the XML representation. The default value is 2.



Required? false

Position? 1

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-InputObject <Object>

The object(s) to serialize.



Required? false

Position? 2

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Style

Whether to export as byte (better compression) or as string (often easier to transmit using other

utilities/apis).



Required? false

Position? 3

Default value String

Accept pipeline input? false

Accept wildcard characters? false



-NoCompression [<SwitchParameter>]

By default, exported data is compressed, saving a lot of storage at the cost of some CPU cycles.

This switch disables this compression, making string-style exports compatible with Import-Clixml.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ChildItem | ConvertTo-PSFClixml



Scans all items in the current folder and then converts that into a compressed clixml string.











RELATED LINKS