PowerShell Logo Small

Export-Clixml



This is the built-in help made by Microsoft for the command 'Export-Clixml', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates an XML-based representation of an object or objects and stores it in a file.

SYNTAX


Export-Clixml [-Path] <string> -InputObject <psobject> [-Depth <int>] [-Encoding <string>] [-Force] [-NoClobber] [-Confirm] [-WhatIf] [<CommonPar
ameters>]



Search powershellhelp.space

DESCRIPTION


The Export-Clixml cmdlet creates an XML-based representation of an object or objects and stores it in a file. You can then use the Import-CLIXML
cmdlet to re-create the saved object based on the contents of that file.

This cmdlet is similar to ConvertTo-XML, except that Export-Clixml stores the resulting XML in a file. ConvertTo-XML returns the XML, so you can
continue to process it in Windows PowerShell.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113297
Import-Clixml
ConvertTo-XML
Export-Csv
ConvertTo-Html

REMARKS

<

Examples


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

C:\PS>"This is a test" | export-clixml sample.xml



Description
-----------
This command creates an XML file that stores a representation of the string, "This is a test".








-------------------------- EXAMPLE 2 --------------------------

C:\PS>get-acl C:\test.txt | export-clixml -Path fileacl.xml

C:\PS> $fileacl = import-clixml fileacl.xml



Description
-----------
This example shows how to export an object to an XML file and then create an object by importing the XML from the file.

The first command uses the Get-ACL cmdlet to get the security descriptor of the Test.txt file. It uses a pipeline operator to pass the security d
escriptor to Export-Clixml, which stores an XML-based representation of the object in a file named FileACL.xml.

The second command uses the Import-Clixml cmdlet to create an object from the XML in the FileACL.xml file. Then, it saves the object in the $File
Acl variable.