Start Full Crawl
#Start Full Crawl
#input parameter
$searchAppName="Enterprise Search Service Application"
$searchapp = Get-SPEnterpriseSearchServiceApplication $searchAppName
$CrawlContent = Get-SPEnterpriseSearchServiceApplication $searchapp| Get-SPEnterpriseSearchCrawlContentSource
if ( $CrawlContent.CrawlStatus -eq "Idle" ) {
$CrawlContent.StartFullCrawl()
}
$CrawlContent.CrawlStatus
while ($CrawlContent.CrawlStatus -ne "Idle")
{
start-sleep -s 60 #wait one minute
write-host $CrawlContent.CrawlStatus
}
write-host "Full crawl finished."