Skip to content

ConvertFrom XmlElement

github-actions edited this page Jun 3, 2026 · 1 revision

external help file: XMLLab-help.xml Module Name: XMLLab online version: schema: 2.0.0

ConvertFrom-XmlElement

SYNOPSIS

Converts named nodes of an element to properties of a PSObject, recursively.

SYNTAX

Document

ConvertFrom-XmlElement [-Document] <XmlDocument> [-OnlyAttributes] [-SimpleSuccession]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Element

ConvertFrom-XmlElement [-Element] <XmlElement> [-OnlyAttributes] [-SimpleSuccession]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

SelectXmlInfo

ConvertFrom-XmlElement [-SelectXmlInfo] <SelectXmlInfo> [-OnlyAttributes] [-SimpleSuccession]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

{{ Fill in the Description }}

EXAMPLES

EXAMPLE 1

Select-Xml /configuration/appSettings/add web.config |ConvertFrom-XmlElement

key value


webPages:Enabled false

PARAMETERS

-Document

The XML document to convert to a PSObject.

Type: XmlDocument
Parameter Sets: Document
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Element

The XML element to convert to a PSObject.

Type: XmlElement
Parameter Sets: Element
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-SelectXmlInfo

Output from the Select-Xml cmdlet.

Type: SelectXmlInfo
Parameter Sets: SelectXmlInfo
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-OnlyAttributes

Only include attributes, ignore other child nodes.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: Attributes, Atts

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-SimpleSuccession

Replace any simple element that only contains one other element with its child.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: CollapseSimple

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Xml.XmlElement to convert into a PSObject, or

System.Xml.XmlDocument to convert the document element into a PSObject, or

Microsoft.PowerShell.Commands.SelectXmlInfo output from Select-Xml to convert

each selected node into a PSObject.

OUTPUTS

System.Management.Automation.PSCustomObject object created from selected XML.

NOTES

RELATED LINKS

Select-Xml

Clone this wiki locally