Serializes complex content into XML elements.
ConvertTo-XmlElements.ps1 [[-InputObject] <Object>] [-Depth <Int32>] [-SkipRoot]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
ConvertTo-XmlElements.ps1 @{html=@{body=@{p='Some text.'}}}
<html><body><p>Some text.</p></body></html>
[pscustomobject]@{UserName=$env:USERNAME;Computer=$env:COMPUTERNAME} |ConvertTo-XmlElements.ps1
<Computer>COMPUTERNAME</Computer> <UserName>username</UserName>
Get-ChildItem *.txt |ConvertTo-XmlElements.ps1
<PSPath>Microsoft.PowerShell.Core\FileSystem::C:\temp\test.txt</PSPath> <PSParentPath>Microsoft.PowerShell.Core\FileSystem::C:\scripts</PSParentPath> <PSChildName>test.txt</PSChildName> <PSDrive></PSDrive> <PSProvider></PSProvider> <VersionInfo><FileVersionRaw></FileVersionRaw> <ProductVersionRaw></ProductVersionRaw> …
A hash or XML element or other object to be serialized as XML elements.
Each hash value or object property value may itself be a hash or object or XML element.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies how many levels of contained objects are included in the JSON representation. The value can be any number from 0 to 100. The default value is 2. ConvertTo-Json emits a warning if the number of levels in an input object exceeds this number.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 3
Accept pipeline input: False
Accept wildcard characters: False
Do not wrap the input in a root element.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.