Pretty-print XML.
Format-Xml.ps1 [-Xml] <XmlDocument> [-IndentChar <Char>] [-Indentation <Int32>] [-NewLineOnAttributes]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
Get-PSProvider alias |ConvertTo-Xml |Format-Xml.ps1
<Objects> <Object Type=”System.Management.Automation.ProviderInfo”> <Property Name=”ImplementingType” Type=”System.RuntimeType”>Microsoft.PowerShell.Commands.AliasProvider</Property> <Property Name=”HelpFile” Type=”System.String”>System.Management.Automation.dll-Help.xml</Property> <Property Name=”Name” Type=”System.String”>Alias</Property> <Property Name=”PSSnapIn” Type=”System.Management.Automation.PSSnapInInfo”>Microsoft.PowerShell.Core</Property> <Property Name=”ModuleName” Type=”System.String”>Microsoft.PowerShell.Core</Property> <Property Name=”Module” Type=”System.Management.Automation.PSModuleInfo” /> <Property Name=”Description” Type=”System.String”></Property> <Property Name=”Capabilities” Type=”System.Management.Automation.Provider.ProviderCapabilities”>ShouldProcess</Property> <Property Name=”Home” Type=”System.String”></Property> <Property Name=”Drives” Type=”System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSDriveInfo]”> <Property Type=”System.Management.Automation.PSDriveInfo”>Alias</Property> </Property> </Object> </Objects>
Get-PSProvider alias |ConvertTo-Xml |Format-Xml.ps1 -NewLineOnAttributes
<Objects> <Object Type=”System.Management.Automation.ProviderInfo”> <Property Name=”ImplementingType” Type=”System.RuntimeType”>Microsoft.PowerShell.Commands.AliasProvider</Property> <Property Name=”HelpFile” Type=”System.String”>System.Management.Automation.dll-Help.xml</Property> <Property Name=”Name” Type=”System.String”>Alias</Property> <Property Name=”PSSnapIn” Type=”System.Management.Automation.PSSnapInInfo”>Microsoft.PowerShell.Core</Property> <Property Name=”ModuleName” Type=”System.String”>Microsoft.PowerShell.Core</Property> <Property Name=”Module” Type=”System.Management.Automation.PSModuleInfo” /> <Property Name=”Description” Type=”System.String”></Property> <Property Name=”Capabilities” Type=”System.Management.Automation.Provider.ProviderCapabilities”>ShouldProcess</Property> <Property Name=”Home” Type=”System.String”></Property> <Property Name=”Drives” Type=”System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSDriveInfo]”> <Property Type=”System.Management.Automation.PSDriveInfo”>Alias</Property> </Property> </Object> </Objects>
The XML string or document to format.
Type: XmlDocument
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
A whitespace indent character to use, space by default.
Type: Char
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The number of IndentChars to use per level of indent, 2 by default. Set to zero for no indentation.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 2
Accept pipeline input: False
Accept wildcard characters: False
Indicates attributes should be written on a new line.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: SplitAttributes, AttributesSeparated
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.