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.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
4100260298
Posts: 5
Last visit: Fri Aug 03, 2018 9:37 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?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked