Closed PaulWalkerUK closed 6 years ago
If all you need is code that runs periodically, for example for monitoring something periodically, yes this is all what you have to do.
If you need something more reactive, for example to write a Web server in PowerShell, then you'll have to create worker threads that wait for network packets, and distribute tasks to other threads. All the bricks for doing it are there. But please don't ask me for more details. That's your problem, not mine :-)
That's great, thanks
Please can you confirm my understanding of how to implement PSService.ps1?
Am I right in thinking I put my "application code" within the
TimerTick
event handler?If I want to change how frequently it runs, I just change the
$period
variable?The only other things to change are the script name (becomes the service name) and the service display name and description?