PowerShell Logo Small

ConvertTo-Xml



This is the built-in help made by Microsoft for the command 'ConvertTo-Xml', 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.

SYNTAX


ConvertTo-XML [-InputObject] <psobject> [-As <string>] [-Depth <int>] [-NoTypeInformation] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The ConvertTo-Xml cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. To use this cmdlet, pipe one or mor
e objects to the cmdlet, or use the InputObject parameter to specify the object.

When you pipe multiple objects to ConvertTo-XML or use the InputObject parameter to submit multiple objects, ConvertTo-XML returns a single XML d
ocument that includes representations of all of the objects.

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



<

RELATED LINKS

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

REMARKS

<

Examples


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

C:\PS>get-date | convertto-xml



Description
-----------
This command converts the current date (a DateTime object) to XML.








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

C:\PS>convertto-xml -as Document -inputObject (get-process) -depth 3



Description
-----------
This command converts the process objects that represent all of the processes on the computer into an XML document. The objects are expanded to a
depth of three levels.