Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. $item = Get-Item .
  2. $options = @{}
  3. [Sitecore.ContentSearch.ContentSearchManager]::Indexes | Foreach-Object { $options.Add($_.Name, $_.Name) }
  4. $props = @{
  5. Parameters = @(
  6. @{Name="indexName"; Title="Choose an index"; Options=$options; Tooltip="Choose one."}
  7. )
  8. Title = "Index selector"
  9. Description = "Choose an index."
  10. Width = 300
  11. Height = 300
  12. ShowHints = $true
  13. }
  14. $result = Read-Variable @props
  15. if ($result -eq "ok") {
  16. $indexName
  17. $index = [Sitecore.ContentSearch.ContentSearchManager]::GetIndex($indexName)
  18. [Sitecore.ContentSearch.Maintenance.IndexCustodian]::Refresh($index, [Sitecore.ContentSearch.SitecoreIndexableItem]$item)
  19. }
  20. Close-Window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement