Skip to content

Instantly share code, notes, and snippets.

@websterian
Last active January 6, 2020 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save websterian/701766d11cbe635b1e2305dba5b326dd to your computer and use it in GitHub Desktop.
Save websterian/701766d11cbe635b1e2305dba5b326dd to your computer and use it in GitHub Desktop.
Runs the Sellable item Interval Asynchronous Strategy
#Change these for your environment...
$pathToKernel = 'C:\inetpub\wwwroot\XP0.sc\bin\Sitecore.Kernel.dll'
$indexName = "sitecore_master_index"
$strategyName = "sellableItemsIntervalAsynchronousStrategyMaster"
#Loads the kernel...
try
{
Add-Type -Path $pathToKernel
}
catch
{
$_.Exception.LoaderExceptions | %
{
Write-Error $_.Message
}
}
Write-output "Starting..."
$index = [Sitecore.ContentSearch.ContentSearchManager]::GetIndex($indexName)
Write-output "Loaded Index..." $index.Name
$node = [Sitecore.Configuration.Factory]::GetConfigNode("contentSearch/indexConfigurations/indexUpdateStrategies/" + $strategyName)
$name = [Sitecore.Xml.XmlUtil]::GetAttribute("type", $node)
Write-output "Loaded type..." $name
$obj = [Sitecore.Configuration.Factory]::CreateObject($node, $true)
$obj.Initialize($index)
Write-output $obj.IncrementalIndexListName
Write-output $obj.ItemsToTake
Write-output $obj.Environments
Write-output "Running..."
$obj.Run()
Write-output "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment