Skip to content

Commit

Permalink
(chocolatey#63) Add MachineContactTimeout step param
Browse files Browse the repository at this point in the history
Previously, ChocoCCM was unable to set the machine contact timeout.

With this change, we add the new parameter and allow users to select a
contact timeout according to their needs.

Just like in the CCM UI, the value is defaulted to zero.
  • Loading branch information
vexx32 committed Jun 30, 2022
1 parent d2f7a5d commit cbbf577
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Public/New-CCMDeploymentStep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ function New-CCMDeploymentStep {
.PARAMETER TargetGroup
The group(s) the step will target
.PARAMETER ExecutionTimeoutSeconds
.PARAMETER ExecutionTimeout
How long to wait for the step to timeout. Defaults to 14400 (4 hours)
.PARAMETER MachineContactTimeout
How long to wait for computers to check in to start the deployment before timing out.
Defaults to 0 (no timeout).
.PARAMETER FailOnError
Fail the step if there is an error. Defaults to True
Expand Down Expand Up @@ -104,8 +108,14 @@ function New-CCMDeploymentStep {
$TargetGroup = @(),

[Parameter()]
[Alias('ExecutionTimeoutSeconds', 'ExecutionTimeoutInSeconds')]
[string]
$ExecutionTimeout = '14400',

[Parameter()]
[Alias('MachineContactTimeoutInSeconds', 'MachineContactTimeoutSeconds')]
[string]
$ExecutionTimeoutSeconds = '14400',
$MachineContactTimeout = 0,

[Parameter()]
[switch]
Expand Down Expand Up @@ -160,6 +170,7 @@ function New-CCMDeploymentStep {
)
)
executionTimeoutInSeconds = $ExecutionTimeout
machineContactTimeoutInMinutes = $MachineContactTimeout
requireSuccessOnAllComputers = $RequireSuccessOnAllComputers
failOnError = $FailOnError
validExitCodes = $ValidExitCodes -join ','
Expand Down Expand Up @@ -207,4 +218,4 @@ function New-CCMDeploymentStep {
}

}
}
}

0 comments on commit cbbf577

Please sign in to comment.