$serviceApp = New-SPStateServiceApplication -Name "StateService"
Create a State Service database and associate it with a service application, by typing:
New-SPStateServiceDatabase -Name "StateServiceDatabase" -ServiceApplication $serviceApp
Create a State Service Application Proxy and associate it with the service application by typing:
New-SPStateServiceApplicationProxy -Name "StateService" -ServiceApplication $serviceApp -DefaultProxyGroup