PowerShell / PSDscResources

MIT License
129 stars 53 forks source link

Service: Resource doesn't support setting recovery actions #83

Open saguiitay opened 7 years ago

saguiitay commented 7 years ago

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
johlju commented 6 years ago

This is similar to issue #69, which proposes recovery options and this issue proposes recovery actions.

RandomNoun7 commented 4 years ago

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?

johlju commented 4 years ago

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?

RandomNoun7 commented 4 years ago

Well, I guess we’ll find out if does anything else or not. ¯_(ツ)_/¯