0

I am currently using Octopus to publish web services. Is there any way to start the services after publishing it automatically using power shell script or any other way.

Thanks

sam
  • 4,594
  • 12
  • 61
  • 111
  • 1
    Which services? If you are talking about IIS just add `IISReset /force` or `Restart-Service w3svc`(which is _not_ the recommended way) to your postdeploy script. – Raf Jul 03 '14 at 09:23
  • Possible duplicate of [How to get IIS site to start up automatically after deployment?](https://stackoverflow.com/questions/33983696/how-to-get-iis-site-to-start-up-automatically-after-deployment) – Richardissimo Nov 08 '18 at 06:02

1 Answers1

0

If your aim is to spin up your app pool so that the first request doesn't take longer than normal, you can issue the following in your post-deploy.ps1

Invoke-WebRequest -Uri "http://localhost/SomeTestPage"

Of if you have .NET 4:

http://weblogs.asp.net/scottgu/auto-start-asp-net-applications-vs-2010-and-net-4-0-series

Robert Wagner
  • 17,515
  • 9
  • 56
  • 72