ISHRemote icon indicating copy to clipboard operation
ISHRemote copied to clipboard

Add cmdlet Wait-IshPublicationOutput

Open ddemeyer opened this issue 6 years ago • 0 comments

Quick drop from my personal notes to share an idea on community.sdl.com... Main idea is that API-wise your only option to know if publishing is done, is by polling for it. If you are on the server a PublishPostPlugin could trigger the actual moment that publishing is done but that is a different story.

Ideas here are...

  • Inspired by the demo a cmdlet that understands FPUBSTATUS and the coming isdeployed field
  • So immediately continues on most statusses, prints something upon status change
  • Parameters similar to Get-IshPublicationOutput, and -Sleep defaults 60s, -Timeout defaults 3600s as maximum wait to then error out
  • Taking -IshObject[] should allow to watch multiple and forward over the pipeline for file download for example using write-progress to indicate remaining polls or remaining timeout or both
  • Taking a -Status[] defaulting to the classic finish statusses, but this would allow to know when a pending publish becomes a picked up publish. Existing Wait-cmdlet inspiration https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/wait-event?view=powershell-6
  • Write-Progress could be shown progressing every pipeline object passed… Help text could refresh counting down from -Timeout
  • Predictable sleep or dynamic based on baseline count + 1000 div 1000 x Sleep of the smallest remaining IshObject to wait for
  • Can this function be written in pure-PowerShell as script, or for simplicity still do it in C#?
  • Double-check if a more optimal implementation for 13SP2/13.0.2 and up over Get-IshBackgroundTask logic/API is possible

References

  • https://community.sdl.com/developers-more/developers/tridiondocs-developers/f/livecontent_developer_forum/38137/how-to-check-for-when-a-publishing-job-is-complete
  • https://community.sdl.com/product-groups/tridion/tridion-docs/f/forum/27552/publishing-apis-help/88970#88970

ddemeyer avatar Nov 29 '19 17:11 ddemeyer