(#63) Add -MachineContactTimeout parameter for New-CcmDeploymentStep - #65
Open
vexx32 wants to merge 3 commits into
Open
(#63) Add -MachineContactTimeout parameter for New-CcmDeploymentStep#65vexx32 wants to merge 3 commits into
vexx32 wants to merge 3 commits into
Conversation
Ensure attribute usage has consistent casing, reformat the hashtable for the request body to be easier to read and use consistent casing for its keys and variables. Rewrote small portions of script that were redundant, overly complicated or difficult to read.
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.
vexx32
force-pushed
the
63-add-missing-param
branch
from
July 6, 2023 19:58
cbbf577 to
9bea49f
Compare
vexx32
commented
Jul 20, 2023
Comment on lines
+165
to
+168
| executionTimeoutInSeconds = $ExecutionTimeout | ||
| machineContactTimeoutInMinutes = $MachineContactTimeout | ||
| requireSuccessOnAllComputers = $RequireSuccessOnAllComputers | ||
| failOnError = $FailOnError |
Member
Author
There was a problem hiding this comment.
Suggested change
| executionTimeoutInSeconds = $ExecutionTimeout | |
| machineContactTimeoutInMinutes = $MachineContactTimeout | |
| requireSuccessOnAllComputers = $RequireSuccessOnAllComputers | |
| failOnError = $FailOnError | |
| executionTimeoutInSeconds = $ExecutionTimeout | |
| machineContactTimeoutInMinutes = $MachineContactTimeout | |
| requireSuccessOnAllComputers = $RequireSuccessOnAllComputers.IsPresent | |
| failOnError = $FailOnError.IsPresent |
JSON serialization doesn't handle these well, it treats a [switch] parameter object as an object with the form { IsPresent: true } rather than a raw boolean, make sure we take the inner property explicitly (this should be fixed below for consistency as well)
vexx32
commented
Jul 20, 2023
| } | ||
| name = $Name | ||
| deploymentPlanId = (Get-CCMDeployment -Name $Deployment).id | ||
| deploymentStepGroups = @( |
Member
Author
There was a problem hiding this comment.
Suggested change
| deploymentStepGroups = @( | |
| deploymentStepGroups = [System.Collections.Generic.List[psobject]]@( |
This cast ensures the collection is always preserved during json serialization; it seems some versions of powershell unwrap a one-element array, but leave other collection types intact.
corbob
requested changes
Jul 21, 2023
vexx32
force-pushed
the
63-add-missing-param
branch
from
July 24, 2023 21:06
04369d5 to
5f26f8e
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description Of Changes
-MachineContactTimeoutparameter to New-CcmDeploymentStep-ExecutionTimeoutMinutesparameter to match the new one as-ExecutionTimeout, and added an alias to the old name to avoid breaking folksMotivation and Context
Previously, ChocoCCM was unable to set the machine contact timeout for a deployment step. 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.
Testing
New-CcmDeploymentStep -Deployment $deploymentName -Name "testing machine contact timeout" -Type Basic -ChocoCommand Install -PackageName 7zip -MachineContactTimeout 5Change Types Made
Related Issue
Fixes #63
Change Checklist