external help file: SitecoreInstallFramework-help.xml
online version:
schema: 2.0.0
---
Sets values in an XML document.
Invoke-SetXmlTask -FilePath <String> -XPath <String> -Element <String> [-Value <String>]
[-Attributes <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]
Invoke-SetXmlTask -FilePath <String> -XPath <String> [-Value <String>] [-Attributes <Hashtable>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Sets the value at the given XPath or creates an element and then sets the value.
Optionally, a hashtable of attributes may be provided to set attributes on the
element.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Value test
Sets the value of //root/config in the file to be 'test'.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Attributes @{ extra = 'test' }
Adds or updates the //root/config element with an attribute called 'extra' and
a value of 'test'.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Element test -value test2 -Attributes @{ extra = 'test3' }
Adds a new element at //root/config/text with a value of 'test2' and an 'extra'
attribute with a value of 'test3'.
A hashtable of attributes to be set or created.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The name of a new element to add.
Type: String
Parameter Sets: Add
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to an XML document.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The value to set at the given XPath.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The XPath to locate in the XML document.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
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 (http://go.microsoft.com/fwlink/?LinkID=113216).