I want to reindex page library using powershell. I have try with c# code. Code is below.
void Main()
{
using (SPSite site = new SPSite("http://demosvr1/web1/"))
using (SPWeb web = site.OpenWeb())
{
SPList docList = web.Lists["Documents"];
object versionObj = docList.RootFolder.Properties["vti_searchversion"];
int version = ((versionObj is int) ? ((int) versionObj) : 0);
docList.RootFolder.SetProperty("vti_searchversion", (version + 1));
docList.Update();
}
}
How to do that using powershell ?