Last active
January 21, 2017 09:15
-
-
Save BenGGolden/71187ea593d8b00706f23280932eb47e to your computer and use it in GitHub Desktop.
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
$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