title: How can I automate a Topshelf interactive service install?
body: <p>I have a couple Topshelf services that run under a specific service account. If I install the services manually from a command line, I can use the --interactive flag, and a dialog box comes up allowing me to enter the username and password. I'd like to be able to automate this through a Powershell script.</p>
  
  <p>Does anyone know how to do this? (Not concerned about Powershell specifically, but with how can I provide the username and password in any installation script.)</p>
  
  <p>As Travis mentioned, I took a look at the command line options. Almost working for me, but now I have one escaping issue. To install, you can type, e.g.,
  MyService.exe install -username:Foo -password:Bar.</p>
  
  <p>However, I have to provide both the domain and username for the username option (I know this from doing the --interactive route):
  MyService.exe install -username:mydomain\$myusername -password:Bar</p>
  
  <p>I cannot find a way to escape this that works! Sorry -- my question has morphed into something else, might need to mark it answered and open a different one.</p>