Hello,
I've been playing a bit with this and overall get how it works and have created/installed a basic service without issue:
https://www.sapien.com/blog/2017/07/12/ ... owershell/
I'm sure I'm just missing something but I'm trying to prevent the service from starting should something like a file/directory/reg key not be present. As as an example, one thing I've tried is this:
if (-Not (Test-Path "C:\ValidationFolder")) {Exit}
But I've also tried triggering the function Stop-MyService, creating my own functions, inserting code like the above within, etc.
I'm running PrimalScript 2019 v7.4.125.0
Thx!
Windows Service Validation Check to Inhibit Service Start
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.
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.
Re: Windows Service Validation Check to Inhibit Service Start
Just make you checks in "Service-MyService" and don't set the bServiceRunning flag so the service will nver enter the run loop.
Why is that an issue?
Why is that an issue?