Last active
January 6, 2020 15:54
-
-
Save websterian/701766d11cbe635b1e2305dba5b326dd to your computer and use it in GitHub Desktop.
Runs the Sellable item Interval Asynchronous Strategy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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