PSDscResources
PSDscResources copied to clipboard
Service: Resource doesn't support setting recovery actions
When creating a new Windows Service, you might want to specify the Recovery Action settings. The Service resource doesn't support those, which forces you to implement it manually using a Script resource, that executes:
sc failure <ServiceName> reset=120 actions=restart/60000/restart/120000/restart/180000
sc failureflag <ServiceName> 1
This is similar to issue #69, which proposes recovery options and this issue proposes recovery actions.
Does it seem like there's much value in putting a lot of work into avoiding the use of sc.exe and attempting to go directly to the registry to accomplish this? Or punt and use sc as the provider for this?
If sc
only sets the registry and doesn’t do anything else behind the scene then setting registry entires sound like the easier road to go. Skip all the error ha sling by calling sc
?
Well, I guess we’ll find out if does anything else or not. ¯_(ツ)_/¯