Trying to get a script to run as a service using NSSM, following this guide
Service appears to be installed.
PS C:\powershell> Get-Service $servicename
Status Name DisplayName
Stopped PMimagewatcher PMimagewatcher
When I try to start it, get this error
PS C:\powershell> Start-Service $servicename
Start-Service : Failed to start service 'PMimagewatcher (PMimagewatcher)'.
At line:1 char:1
+ Start-Service $servicename
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], S
erviceCommandException
+ FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand
I should add, I'm only looking for someway to ensure that this script runs continually when the server is up. A service seems like the logical choice, but if there is some other way to do this then I'm open to it.