Set-ItemTemplate
Sets the item template.
Syntax
Detailed Description
The Set-ItemTemplate command sets the template for an item.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
Parameters
-Item <Item>
The item to set the template for.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
true (ByValue)
Accept Wildcard Characters?
false
-Path <String>
Path to the item to set the template for.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Id <String>
Id of the item to set the template for.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-TemplateItem <TemplateItem>
Sitecore item representing the template.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Template <String>
Path representing the template item. This must be of the same database as the item to be altered.
Required?
true
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-FieldsToCopy <Hashtable>
Hashtable of key value pairs mapping the old template field to a new template field.
@{"Title"="Headline";"Text"="Copy"}
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Database <String>
Database containing the item to set the template for - required if item is specified with Id.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Sitecore.Data.Items.Item
Notes
Help Author: Adam Najmanowicz, Michael West, Alex Washtell
Examples
EXAMPLE 1
Set template of /sitecore/content/home item using a Template path.
EXAMPLE 2
Set template of /sitecore/content/home item using a TemplateItem.
EXAMPLE 3
Set the template and remap fields to their new name.
Related Topics
Last updated