4

Using below article we can publish a Page using Powershell script. http://sharedbyjan.blogspot.in/2014/01/publish-stuff-from-powershell.html

Is there any way we can publish all SG’s within the Publication using PowerShell? The requirement is to publish content[SG’s/multiple Pages] from different Publications using PowerShell scripts.

  • Have you tried passing a Structure Group ID instead of a page ID? – Nuno Linhares Mar 30 '18 at 12:04
  • I am successfully able to publish Pages,SG's to multiple publication targets. I have a question: -> Is there any way we can include the flag : Un-check the checkbox in the publish dialog that says 'Republish only (Do not publish new content)' -> While publishing SG's if any item fail will it create issues to the other items with in the SG to publish? – Sravan Apr 5 '18 at 14:53
4

Is there any way we can publish all SG’s within the publication using PowerShell?

Answer is yes. You can publish any sort of items using $client.Publishmethod. These items are pages, structure groups, components, keywords, bundles, templates etc... To publish them just provide their tcm ids (tcm id of structure group).

Besides this, to answer second part of your question, publish method accepts array of ids of items to publish and array of publication target ids so you can all provide them in same call: enter image description here

| improve this answer | |
  • I prefer using webdav URLs in publish scripts. It's very common that you want to do the same publish actions across environments. – Dominic Cronin Mar 30 '18 at 15:48
  • I agree @Dominic. Webdav URL are the most optimal solution. – Marko Milic Mar 30 '18 at 16:19
  • My point was on showing that he can send tcm of any publishable item and that he can send array of items :D – Marko Milic Mar 30 '18 at 16:40
  • I am successfully able to publish Pages,SG's to multiple publication targets. I have a question: -> Is there any way we can include the flag : Un-check the checkbox in the publish dialog that says 'Republish only (Do not publish new content)' -> While publishing SG's if any item fail will it create issues to the other items with in the SG to publish? – Sravan Apr 5 '18 at 12:52
  • Actually yes, you can do that within PublishInstructionsData. It has property ResolveInstructions. And there you can set if its Purpose property to Publish, or RePublish. – Marko Milic Apr 10 '18 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.