Exports (serializes) the Sitecore item to the filesystem.
Export-Item [-Entry <IncludeEntry>] [-Recurse] [-ItemPathsAbsolute] [-Root <String>]
Export-Item [-Item] <Item> [-Recurse] [-ItemPathsAbsolute] [-Root <String>]
Export-Item [-Path] <String> [-Recurse] [-ItemPathsAbsolute] [-Root <String>]
Export-Item -Id <String> [-Database <String>] [-Recurse] [-ItemPathsAbsolute] [-Root <String>]
The Export-Item command serializes Sitecore items to the filesystem. The alias for the command is Serialize-Item. The simplest command syntax is: Export-Item -path "master:\content"
or
Get-Item "master:\content" | Export-Item
Both of them will serialize the content item in the master database. In first case we pass the path to the item as a parameter, in second case we serialize the items which come from the pipeline. You can send more items from the pipeline to the Export-Item command, e.g. if you need to serialize all the descendants of the home item created by sitecore\admin, you can use:
Get-Childitem "master:\content\home" -recurse | Where-Object { $_."__Created By" -eq "sitecore\admin" } | Export-Item
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
The following abbreviations are aliases for this cmdlet:
- Serialize-Item
Serialization preset to be serialized. Obtain the preset through the use of Get-Preset command.
| Aliases | |
|---|---|
| Required? | false |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | true (ByValue, ByPropertyName) |
| Accept Wildcard Characters? | false |
Process the item and all of its children - switch which decides if serialization concerns only the single item or the whole tree below the item, e.g.
Export-Item -path "master:\content\articles" -recurse
Root - directory where the serialized files should be saved, e.g. Export-Item -path "master:\content" -Root "c:\tmp"
| Aliases | |
|---|---|
| Required? | false |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
Works only with Root parameter and decides if folder structure starting from "sitecore\content" should be created, e.g. if you want to serialize articles item in directory c:\tmp\sitecore\content you can use. For example: Export-Item -Path "master:\content\articles" -ItemPathsAbsolute -Root "c:\tmp"
| Aliases | |
|---|---|
| Required? | false |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
Directory where the serialized files should be saved, e.g.
Export-Item -Path "master:\content" -Root "c:\tmp"
| Aliases | |
|---|---|
| Required? | false |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
The item to be serialized.
| Aliases | |
|---|---|
| Required? | true |
| Position? | 1 |
| Default Value | |
| Accept Pipeline Input? | true (ByValue, ByPropertyName) |
| Accept Wildcard Characters? | false |
Path to the item to be processed - can work with Language parameter to narrow the publication scope.
| Aliases | |
|---|---|
| Required? | true |
| Position? | 1 |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
You can pass the id of serialized item instead of path, e.g. Export-Item -id "{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}"
| Aliases | |
|---|---|
| Required? | true |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
| Aliases | |
|---|---|
| Required? | false |
| Position? | named |
| Default Value | |
| Accept Pipeline Input? | false |
| Accept Wildcard Characters? | false |
The input type is the type of the objects that you can pipe to the cmdlet.
- Sitecore.Data.Items.Item
Help Author: Marek Musielak, Adam Najmanowicz, Michael West
PS master:\> Export-Item -Path master:\content\home- https://github.com/SitecorePowerShell/Console/
- Get-Preset
- Import-Item
- https://www.youtube.com/watch?v=60BGRDNONo0&list=PLph7ZchYd_nCypVZSNkudGwPFRqf1na0b&index=7
- https://gist.github.com/AdamNaj/6c86f61510dc3d2d8b2f
- https://stackoverflow.com/questions/20266841/sitecore-powershell-deserialization
- https://stackoverflow.com/questions/20195718/sitecore-serialization-powershell
- https://stackoverflow.com/questions/20283438/sitecore-powershell-deserialization-core-db