Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 5bc59a3

Browse files
committed
Merge pull request #121 from afsandeberg/reindexlist
Added ReIndexList cmdlet
2 parents ac8a4de + 6234323 commit 5bc59a3

File tree

2 files changed

+495
-467
lines changed

2 files changed

+495
-467
lines changed

Commands/Lists/RequestReIndexList.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.SharePoint.Client;
2+
using System.Management.Automation;
3+
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;
4+
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
5+
6+
namespace OfficeDevPnP.PowerShell.Commands.Lists
7+
{
8+
[Cmdlet(VerbsLifecycle.Request, "SPOReIndexList")]
9+
[CmdletHelp("Marks the list for full indexing during the next incremental crawl",
10+
Category = CmdletHelpCategory.Lists)]
11+
public class RequestReIndexList : SPOWebCmdlet
12+
{
13+
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, HelpMessage = "The ID, Title or Url of the list.")]
14+
public ListPipeBind Identity;
15+
16+
protected override void ExecuteCmdlet()
17+
{
18+
var list = Identity.GetList(SelectedWeb);
19+
20+
if (list != null)
21+
{
22+
list.ReIndexList();
23+
}
24+
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)