I wrote a program in PowerShell that sings and verifies things. I would like to convert this to a windows service. I created a Windows service (in Admin-> Services), but I cannot start it. I am sure that I am missing the correct interface that the system must call to start / stop / pause / etc service.
I can find many examples when it comes to this in VB / C # / MS-lang, but nothing is known about how to do this using PowerShell. Is there any documentation (or, preferably, code examples) to help with this?
If you absolutely want to run your PowerShell code in a service, I think you can write a C # service wrapper for PowerShell code.
You have found examples of how to create a service with C #, and simply call it Powershell with C # . Therefore, I am surprised that since a small SrvAny-oriented PowerShell does not exist yet,
My advice here is to better rewrite your code in C # as a service.
There are a few questions here:
CreateProcessAsUser
( ), , , . PowerShell script . , - srvany, Windows Server 2003 Resource Kit, .
srvany
Script PowerGUI: http://documents.software.dell.com/DOC144271
, SrvAny.exe Microsoft ( , , Windows 2000 Resource Kit. (.exe,.cmd ..). VBScripts, - Srvany.exe, Windows 2003 Windows 2008 ( 64-). 100% ( script ), Windows, (.. /Startup, , , . SrvAny.exe( ). Windows, . , , , srvany.exe
http://www.firedaemon.com/
Allows you to run something as a service. There are also free alternatives to this application, which does the same.