-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#63) Add -MachineContactTimeout parameter for New-CcmDeploymentStep #65
base: develop
Are you sure you want to change the base?
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.
cbbf577
to
9bea49f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
src/Public/New-CCMDeploymentStep.ps1
Outdated
executionTimeoutInSeconds = $ExecutionTimeout | ||
machineContactTimeoutInMinutes = $MachineContactTimeout | ||
requireSuccessOnAllComputers = $RequireSuccessOnAllComputers | ||
failOnError = $FailOnError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
} | ||
name = $Name | ||
deploymentPlanId = (Get-CCMDeployment -Name $Deployment).id | ||
deploymentStepGroups = @( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
04369d5
to
5f26f8e
Compare
Description Of Changes
-MachineContactTimeout
parameter to New-CcmDeploymentStep-ExecutionTimeoutMinutes
parameter 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 5
Change Types Made
Related Issue
Fixes #63
Change Checklist