New-CMPackageDeployment missing parameter to specify deployment expiration time.
We currently use the cmdlet Start-CMPackageDeployment to create deployments to our patching collection and schedule reboots. We use the parameter DeploymentExpireDateTime to set the expiration for the deployment. We are now getting a message that start-cmpackagedeployment is being deprecated in favor of New-CMPackageDeployment, but the new command doesn't appear to have a parameter to set the deployment expiration time. Oddly, it does have a parameter "-UseUtcForExpireSchedule", so possibly it's just an omission?
I just double checked the cmdlet code, and DeadlineDateTime looks like the parameter you’re looking for.
We’re painfully aware about the docs being out of date and this is something we’re actively working on addressing.
Thank you for your feedback.
AdminAdam Meltzer (ConfigMgr Product Team) (Software Engineer, System Center Configuration Manager) commented
We're working on allowing submissions for the PowerShell docs. :)
Thanks for looking that up and clarifying that it is indeed the same functionality Adam!
Can you tell us what the ConfigMgr Product Team policy on the commandlet documentation on docs.microsoft.com is? As far as I can see it's not managed through GitHub yet, so there's also no way to contribute to the documentation :(
From how New-CMPackageDeployment behaves, DeploymentExpireDateTime might have just been renamed to DeadlineDateTime - but there is absolutely no documentation on this :(
"-DeadlineDateTime ((get-date).adddays(+$ExpirationInDays)).DateTime" gives the exact same result as "-DeploymentExpireDateTime ((get-date).adddays(+$ExpirationInDays)).DateTime" does (tested with 1802 cmdlets on ConfigMgr 1802)
I'm also not sure how to interpret this. When Start-CMPackageDeployment was introduced the docs page at least mentioned -DeploymentExpireDateTime specifically as a replacement for several parameters (https://docs.microsoft.com/en-us/powershell/module/configurationmanager/start-cmpackagedeployment?view=sccm-ps) but New-CMPackageDeployment does not even mention it anywhere (https://docs.microsoft.com/en-us/powershell/module/configurationmanager/new-cmpackagedeployment?view=sccm-ps)