Problem with "Windows Service - Start" step template

When one of our tentacles invokes the “Windows Service - Start” public step template, we get this error:

Start-Service : Cannot find any service with service name ‘System.ServiceProcess.ServiceController’.
At C:\StartDeliverySvc.ps1:9 char:18

  • start-service <<<<  $serviceInstance
    
    • CategoryInfo : ObjectNotFound: (System.ServiceProcess.ServiceController:String) [Start-Service], Servic
      eCommandException
    • FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StartServiceCommand

I took the script from the template and tried to manually run it in powershell on the target box. Same error (I double checked the value of service name and made sure it was set).

Please advise.

Octopus 2.5.5.318
PowerShell 2.0
Windows 2008

Uh oh, looks like this is an issue when using this step template with PowerShell 2.0. Seems to work in PS4.0.

Hi Scott,

I have made an issue in GitHub for us to fix the script to work in PS2.0.
Unfortunately these community made scripts can have these bugs, but as it is a popular one, we will see if we can update it.
Thanks for the report!

If anyone stumbles on to this thread and has the time/means/inclination, we do accept PRs for the library :wink:

Vanessa

That brings up an interesting question. How do existing step template consumers know that a step template was fixed / enhanced so they can get the new version?

Thanks Vanessa.

scott

Hi Scott,

We have been discussing this internally ourselves, and I believe the plan will be to actually link to the library from within Octopus.

Vanessa