February 2019
Intermediate to advanced
626 pages
15h 51m
English
Export-Clixml creates representations of objects in XML files. Export-Clixml is extremely useful where type information about each property must be preserved.
For example, the following object may be exported using Export-Clixml:
[PSCustomObject]@{
Number = 1
Decimal = 2.3
String = 'Hello world'
} | Export-Clixml .\object.xml
The resulting XML file shows the type for each of the properties it has just exported:
PS> Get-Content object.xml<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="Number">1</I32> <Db N="Decimal">2.3</Db> <S N="String">Hello world</S> ...
Read now
Unlock full access