Here’s a great script by Jeremy Jameson on how to create a SharePoint 2010 Search service application with Powershell.
I was even able to use it to configure search on a SharePoint 2010 server which was not joined to the domain (as sometimes is required for DMZ deployments). It worked beautifully using local computer accounts. There is a change that needs to be made to the script if you’re using local accounts:
Add ShareName and Index arguments as shown below.
$queryComponent = New-SPEnterpriseSearchQueryComponent -QueryTopology $queryTopology -IndexPartition $indexPartition -SearchServiceInstance $queryInstance -Debug:$false -ShareName <SHARENAME> -IndexLocation <INDEXLOCATION>