Write a service in powershell

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 5
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Fri Nov 14, 2014 7:02 am

Write a service in powershell

Post by 4100260298 »

I need to do some testing with a service. I'm wondering if it is possible to write a service with the appropriate handlers in powershell?

Posts: 14444
Joined: Tue May 22, 2007 9:57 am

Re: Write a service in powershell

Post by jvierra »

No. PowerShell is not appropriate for creating a service. It cannot respond to service control. You can use the SDK to create a service that can host PowerShell scripts. Look into the Window Platform SDK PowerShell samples.