Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$item = Get-Item .
$options = @{}
[Sitecore.ContentSearch.ContentSearchManager]::Indexes | Foreach-Object { $options.Add($_.Name, $_.Name) }
$props = @{
Parameters = @(
@{Name="indexName"; Title="Choose an index"; Options=$options; Tooltip="Choose one."}
)
Title = "Index selector"
Description = "Choose an index."
Width = 300
Height = 300
ShowHints = $true
}
$result = Read-Variable @props
if ($result -eq "ok") {
$index = [Sitecore.ContentSearch.ContentSearchManager]::GetIndex($indexName)
[Sitecore.ContentSearch.Maintenance.IndexCustodian]::Refresh($index, [Sitecore.ContentSearch.SitecoreIndexableItem]$item)
}
Close-Window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment