In an effort to setup Enterprise Search in SharePoint 2013 using PowerShell to make sure every nook and cranny was covered, I came across a number of scripts, but none seemed to do as good of a job as this one. I’m not sure what the original source is or who put it together, but it worked flawlessly. This is probably by far the best PowerShell script I have found for setting up Enterprise Search that does a good job of setting up every component. Enjoy!
Before running, create a folder on a hard drive of your choosing where indexes will be stored. In this case, I used “C:\SPSearchIndexes” for the Index location. This has to be created beforehand, otherwise it will fail!