If you want to set the SharePoint 2010 Enterprise Search Service Application "Default Content Access Account" by using PowerShell you can use this script:
$searchapp = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$c= New-Object Microsoft.Office.Server.Search.Administration.Content($searchapp)
$c.SetDefaultGatheringAccount($crawlUser, (ConvertTo-SecureString $crawlPwd -AsPlainText -force))
($crawlUser is – of cause – the login of the account and $crawlPwd is the password in plain text)
I am trying to use your powershell but I am getting a
Missing ‘)’ in method call.
At C:\search.ps1:3 char:31