Powershell Commands to Upload Query Suggestions in Sharepoint 2013

In my current project requirement, we have to add query suggestions to sharepoint 2013 Search. Here is the powershell script thats been used to upload the query suggestion and kickstart the timer job as well.
  1. $Service = Get-SPEnterpriseSearchServiceApplicationProxy  
  2. $web = Get-SPWeb -Identity http://mysite/Test  
  3. $owner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb $web  
  4. $Fedmanager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager –ArgumentList $Service  
  5. $source = $Fedmanager.GetSourceByName("Local SharePoint Results", $owner)  
  6. Import-SPEnterpriseSearchPopularQueries -SearchApplicationProxy $Service -Filename C:\query.txt -ResultSource $source -Web $web  
  7. $timerjob = Get-SPTimerJob -type "Microsoft.Office.Server.Search.Administration.PrepareQuerySuggestionsJobDefinition"  
  8. $timerjob.RunNow()