1

The Publish-Item command appears to use the older API for publishing (slow).

When I run the script below, I do not see the publishing job appear in the Publishing Service dashboard.

$item = Get-Item -Path "master:" -ID "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"
$item | Publish-Item -PublishMode Smart
  • I've noticed that Publish-Item uses SPS (at least in my 9.0.1 with SPE 4.7 and 5.0), but if I add the -AsJob flag, it uses the old publisher. I understand why this happens, but it's not very logical since SPS will always be a job. – mikaelnet Jan 17 at 14:09
1

The Sitecore Publishing Service module replaces the PublishManager API and in most cases should work as you expect. SPE implements the use of the PublishManager but in a way that does not appear to trigger the SPS code.

Below is an example on how to queue publishing jobs to appear in the Publishing Service dashboard.

$database = Get-Database -Name "master"

$item = Get-Item -Path "master:" -ID "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"

$targets = @()
foreach($publishingTarget in [Sitecore.Publishing.PublishManager]::GetPublishingTargets($database)) {
    $targets += Get-Database -Name $publishingTarget[[Sitecore.FieldIDs]::PublishingTargetDatabase]
}

$languages = [Sitecore.Data.Managers.LanguageManager]::GetLanguages($database)

# Item publish with children
[Sitecore.Publishing.PublishManager]::PublishItem($item,$targets,$languages,$true,$true,$true)

# All Items
[Sitecore.Publishing.PublishManager]::PublishSmart($database,$targets,$languages)

Publishing Dashboard

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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