I have just completed a script that can be used to install a service bus host as a windows service. It is nice to use, when delegating the installs to the support team, this is always done via NServiceBus.Host.exe.
It can always be tricky parsing arguments in PowerShell. The trick is to use the Start-Process command, and isolate the arguments into it’s own variable.
Here is the two scripts.
The one will install the license and the other installs your endpoints as a windows service. All you now need to do, is just type in the password.
It relies on a directory structure, where.
Root\powershellscripts.ps1 Root\ServiceNameA\Debug or Root\ServiceNameA\Release Root\ServiceNameB\Debug or Root\ServiceNameB\Release
I hope this makes installing all your endpoints easy.
Now, remember, if you install Subscriber endpoints before publishers, you will get a race condition, so with this script, add the endpoints in the array argument in the correct dependent order. First install all the publisher endpoints first, then the subscriber endpoints.