After I installed SharePoint I tried to create a SharePoint 2010 Web Analytics service application using PowerShell which ended with the following error message: “Start-SPServiceInstance : Cannot validate argument on parameter 'Identity'. The argument is null. Supply a non-null argument and try the command again.“
I used the script provided by Microsoft TechNet.
Error description
The error message is pretty detailed since it gives a line...
Start-SPServiceInstance : Cannot validate argument on parameter 'Identity'. The argument is null. Supply a non-null argument and try the command again.
At C:\Users\spadmin\Desktop\6_Service Applications_Services\SharePoint Server 2010 Sta\Service Application - Web Analytics.ps1:67 char:32
+ Start-SPServiceInstance <<<< $AnalyticsServiceInstance
+ CategoryInfo: InvalidData: (:) [Start-SPServiceInstance], ParameterBindingValidationException
+ FullyQualifiedErrorId: ParameterArgumentValidationError,Microsoft.SharePoint.PowerShell.SPCmdletStartServiceInstance
But at the end it took me some time to find the error…
Here is the corresponding screenshot:

Solution
In line 3 the last curly bracket is missing… I thought about many different things before I noticed the missing bracket.
#Start Analytics service instances
write-host "Starting Analytics Service instances ..."
$AnalyticsDataProcessingInstance = Get-SPServiceInstance | where-object {$_.Name -eq "WebAnalyticsServiceInstance"} | where-object {$_.Server.Address -eq $CentralAdminServer
$AnalyticsWebServiceInstance = Get-SPServiceInstance | where-object {$_.TypeName -eq "Web Analytics Web Service"} | where-object {$_.Server.Address -eq $CentralAdminServer}

Anyway at the end I was successful deploying the SharePoint 2010 Web Analytics service application and I was able to continue to install SharePoint.