Skip to content

Commit fcac90f

Browse files
committed
Implement embedded instance strategy
1 parent c5671bd commit fcac90f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function Set-TargetResource
315315
$FailureCommand,
316316

317317
[Parameter()]
318-
[System.Object[]]
318+
[Microsoft.Management.Infrastructure.CimInstance[]]
319319
$FailureActionsCollection,
320320

321321
[Parameter()]
@@ -600,7 +600,7 @@ function Test-TargetResource
600600
$FailureCommand,
601601

602602
[Parameter()]
603-
[System.Object[]]
603+
[Microsoft.Management.Infrastructure.CimInstance[]]
604604
$FailureActionsCollection,
605605

606606
[Parameter()]
@@ -1835,7 +1835,7 @@ function Set-ServiceProperty
18351835
$FailureCommand,
18361836

18371837
[Parameter()]
1838-
[System.Object[]]
1838+
[Microsoft.Management.Infrastructure.CimInstance[]]
18391839
$FailureActionsCollection,
18401840

18411841
[Parameter()]
@@ -2349,7 +2349,7 @@ function Set-ServiceFailureActionProperty {
23492349
$FailureCommand,
23502350

23512351
[Parameter()]
2352-
[System.Object[]]
2352+
[Microsoft.Management.Infrastructure.CimInstance[]]
23532353
$FailureActionsCollection,
23542354

23552355
[Parameter()]

source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.schema.mof

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,15 @@ class DSC_xServiceResource : OMI_BaseResource
1616
[Write,Description("An array of strings indicating the names of the dependencies of the service.")] String Dependencies[];
1717
[Write,Description("The time to wait for the service to start in milliseconds. Defaults to 30000.")] uint32 StartupTimeout;
1818
[Write,Description("The time to wait for the service to stop in milliseconds. Defaults to 30000.")] uint32 TerminateTimeout;
19+
[Write,Description("The time to wait for the Failure count to reset in seconds.")] UInt32 ResetPeriodSeconds;
20+
[Write,Description("The command line to run if a service fails.")] String FailureCommand;
21+
[Write,EmbeddedInstance("DSC_xFailureAction"),Description("The actions to take when a service fails.")] String FailureActionsCollection[];
22+
[Write,Description("A flag indicating whether failure actions should be invoked on non-crash failures.")] Boolean FailureActionsOnNonCrashFailures;
23+
};
24+
25+
[ClassVersion("1.0.0")]
26+
class DSC_xFailureAction
27+
{
28+
[Write, Description("The action to take on failure"), ValueMap{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}, Values{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}] String Type;
29+
[Write, Description("Delay in seconds to wait before taking the specified action")] UInt32 DelaySeconds;
1930
};

0 commit comments

Comments
 (0)