Saturday, August 31, 2013

Sitecore PowerShell Extensions Packages and Serialization

I'm at it again. Had fun today creating packages and serializing items with SPE.
Demo Code:

# Serialization
Get-Item -Path "master:\templates\spe\" | Serialize-Item -Recurse

# Packages
$name = "dinner"
$package = New-Package -Name $name

$source = Get-Item "master:\templates\spe" | New-ItemSource -Name "Dinner Plates" -InstallMode Overwrite -MergeMode Merge
$package.Sources.Add($source)

$package | Export-Package -Path "$name.xml"
$package | Export-Package -Path "$name.zip" -Zip

No comments:

Post a Comment