Last active
January 4, 2016 19:39
-
-
Save jhorsman/8668444 to your computer and use it in GitHub Desktop.
Publish a SDL Tridion page trhough PowerShell. Prerequisites: http://code.google.com/p/tridion-powershell-modules/ and any Tridion 2011+ server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up a Tridion Core Service client for the Content Manager server cms.server.com. | |
# The 2013-SP1 label is for the CM server version, other valid entries are 2011-SP1 and 2013. | |
Import-Module Tridion-CoreService | |
Set-TridionCoreServiceSettings cms.server.com 2013-SP1 | |
$client = Get-TridionCoreServiceClient | |
# Set a publish instruction with resolve instruction and render instruction. These are all standard | |
# instructions, nothing special here but you can use this to create a special publinshing action. | |
$publishIntructionData = New-Object Tridion.ContentManager.CoreService.Client.PublishInstructionData | |
$publishIntructionData.RenderInstruction = New-Object Tridion.ContentManager.CoreService.Client.RenderInstructionData | |
$publishIntructionData.ResolveInstruction = New-Object Tridion.ContentManager.CoreService.Client.ResolveInstructionData | |
# Set readOptions, again very standard. | |
$readOptions = New-Object Tridion.ContentManager.CoreService.Client.ReadOptions | |
# Publish the page tcm:69-6164-64 to target tcm:0-1-65537 with publish priority normal. | |
$client.Publish("tcm:69-6164-64", $publishIntructionData, "tcm:0-1-65537", | |
[Tridion.ContentManager.CoreService.Client.PublishPriority]::Normal, $readOptions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment