How to check for when a publishing job is complete

I am automating the publication of several language outputs. I need to know when the publishing job is complete, so I can start the next publishing job. The sample code from an ISHRemote webinar handles this with Start-Sleep like this:

$ishObject = Publish-IshPublicationOutput -IshSession $ishSession -LogicalId $guid -Version 2 -LanguageCombination "en-us" -OutputFormat "PDF (XPP A4)"

Start-Sleep -Seconds 60

This works, but it's not very flexible for when there are longer publishing jobs, etc. What is a good way to check for publication status in real time? I notice that getting the publication object in a variable $publication like below is static and does not update in real time:

$publication = Get-IshPublicationOutput -LogicalId $PubGuid

$publication[1].fishpubstatus

I had the idea of getting the publication newly again every 10 seconds or so, and then checking on fishpubstatus. Is there a better way to go?

Thanks, Mark

Parents
  • That the object in the variable does not refresh is part of the programing model, only the cmdlets will go to the server API to execute/refresh material.

    The question can already be solved using the current cmdlets, there is an idea for a shorthand cmdlet on Add cmdlet Wait-IshPublicationOutput · Issue #72 · RWS/ISHRemote Give that one a thumbs up to help order the backlog. The key problem that the cmdlet would try to solve is to know how often a status-update polling should happen... every 10 seconds will just flood the server if your information architecture already knows it will take 3+ hours or 12+ hours.

    However you probably know roughly how long it will take in your environment, for your chosen OutputFormat...

    I would also reference (+) Publishing APIs help - 01 - General Discussion Forum - Tridion Docs - RWS Community as an interesting read for you.

    -Dave

  • Hi Dave,

    I'm using the latest version (i.e. v0.14-beta) of ISHRemote. I'd like to use the Wait-IshPublicationOutput cmdlet. But I cannot find this cmdlet in the latest version of ISHRemote. Did you disable this cmdlet due to unavoidable reason?

    Thanks,

    Naoki

  • Hi Naoki,

    As I read it, the Wait-IshPublicationOutput cmdlet is not available in the ISHRemote library.
    Dave stated that there is an idea for a shorthand cmdlet it is never stated that this is/was available.

    I guess the key problem around the polling interval is still holding back the implementation and delivery of this cmdlet.

    Kind Regards,

    Raf

Reply
  • Hi Naoki,

    As I read it, the Wait-IshPublicationOutput cmdlet is not available in the ISHRemote library.
    Dave stated that there is an idea for a shorthand cmdlet it is never stated that this is/was available.

    I guess the key problem around the polling interval is still holding back the implementation and delivery of this cmdlet.

    Kind Regards,

    Raf

Children