I'm sure the answer is so simple, but here it is:
I use TopShelf to install my service, and I can successfully install and run it from the command line as
Install MyExecutable.Daemon MyExecutable.Daemon start
This is good, but it should be among the Services, and it was not the way I tried;
sc create "MyExecutable.Daemon" binPath= "C:\'Program Files (x86)'\MyExecutable.Daemon.exe" DisplayName= "MyExecutable.Daemon" start= auto
but got
Set-Content : A positional parameter cannot be found that accepts argument 'binpath='. At line:1 char:1 + sc create MyExecutable.Daemon binpath= "C:\'Program Files (x86)'\... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Set-Content], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetContentCommand
So, I'm stuck here. What am I missing here?
windows powershell install service topshelf
Bilsay
source share