Skip to content

Commit

Permalink
Implement embedded instance strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomNoun7 committed Apr 25, 2020
1 parent c5671bd commit fcac90f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function Set-TargetResource
$FailureCommand,

[Parameter()]
[System.Object[]]
[Microsoft.Management.Infrastructure.CimInstance[]]
$FailureActionsCollection,

[Parameter()]
Expand Down Expand Up @@ -600,7 +600,7 @@ function Test-TargetResource
$FailureCommand,

[Parameter()]
[System.Object[]]
[Microsoft.Management.Infrastructure.CimInstance[]]
$FailureActionsCollection,

[Parameter()]
Expand Down Expand Up @@ -1835,7 +1835,7 @@ function Set-ServiceProperty
$FailureCommand,

[Parameter()]
[System.Object[]]
[Microsoft.Management.Infrastructure.CimInstance[]]
$FailureActionsCollection,

[Parameter()]
Expand Down Expand Up @@ -2349,7 +2349,7 @@ function Set-ServiceFailureActionProperty {
$FailureCommand,

[Parameter()]
[System.Object[]]
[Microsoft.Management.Infrastructure.CimInstance[]]
$FailureActionsCollection,

[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ class DSC_xServiceResource : OMI_BaseResource
[Write,Description("An array of strings indicating the names of the dependencies of the service.")] String Dependencies[];
[Write,Description("The time to wait for the service to start in milliseconds. Defaults to 30000.")] uint32 StartupTimeout;
[Write,Description("The time to wait for the service to stop in milliseconds. Defaults to 30000.")] uint32 TerminateTimeout;
[Write,Description("The time to wait for the Failure count to reset in seconds.")] UInt32 ResetPeriodSeconds;
[Write,Description("The command line to run if a service fails.")] String FailureCommand;
[Write,EmbeddedInstance("DSC_xFailureAction"),Description("The actions to take when a service fails.")] String FailureActionsCollection[];
[Write,Description("A flag indicating whether failure actions should be invoked on non-crash failures.")] Boolean FailureActionsOnNonCrashFailures;
};

[ClassVersion("1.0.0")]
class DSC_xFailureAction
{
[Write, Description("The action to take on failure"), ValueMap{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}, Values{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}] String Type;
[Write, Description("Delay in seconds to wait before taking the specified action")] UInt32 DelaySeconds;
};

0 comments on commit fcac90f

Please sign in to comment.