Im trying to create a job in SSMS 2012 that has three steps. The first step stops a service, second step runs some sql, and the third step starts a service again. In steps one I set the Type to PowerShell, Run as: SQL Server Agent Service Account, and the Command was Stop-Service X. Step three was the same except it was Start-Service X. When I ran the job it ran succesfully, however when I was watching the Task Manager service at the same time the job was running, the status didn't change at all.
Am I missing additional PowerShell code to start and stop the service and/or is there is an issue between the communication with SSMS and PowerShell or even something else?
This is all done on the same machine, no remoting. The rights are all administrative rights.