The Tridion PowerShell Modules project comes in handy to get you a CoreService client. It's just five steps to install this module on your machine.
- Get the .psm1, .psd1 and DLL files from the project.
You can also copy the CoreService DLL from the %TRIDION_HOME%bin\client\CoreService folder on your own Content Manager server if you do not like to download the DLLs from the project. - Create a directory
C:\Users\your_username\Documents\WindowsPowerShell\Modules\Tridion-CoreService - Copy the
.psm1
,.psd1
and.dll
files in that directory - Restart any open PowerShell consoles or run
Import-Module Tridion-CoreService
in the open PowerShell console.
Once you can use the PowerShell module, run a simple script to publish the page.Also see http://tridion.stackexchange.com/questions/4331/how-can-i-publish-a-page-by-using-powershell
As an example administrative task, take this question. For unclear reasons we need to publish a page every hour or so. This is not a Tridion best practice, but easy to automate. Just have a Windows Scheduled Task which runs
powershell -file "C:\publish-a-page.ps1"
. That will do the trick effectively.For future optimization: you could extend the Tridion PowerShell Modules to help you to perform this simple publishing action without setting up the PublishInstruction and ReadOptions and all.
No comments:
Post a Comment