question

VikramMidha-0394 avatar image
0 Votes"
VikramMidha-0394 asked saldana-msft edited

Unable to Figure Out package deployment using Powershell

Hi,

I am trying to work on creating bulk collections and then deploy existing packages on them. Was successful in creating the collections. However, facing issues when using PowerShell to deploy the package using below command.

Set-CMPackageDeployment -CollectionName "collection name here" -PackageName "package name here" -StandardProgramName "package program name" -DeployPurpose Required -DeploymentAvailableDateTime "2020-12-10 13:00"



This is not working failing with "parameter set cannot be resolved using specified name parameters"

Any suggestions?


Thanks!

mem-cm-generalmem-cm-application
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered VikramMidha-0394 commented

Hi,@VikramMidha-0394
For example, we set Deadline to 10 days from now at 8PM, I test the script in my lab, it create the deployment well:

 [datetime]$DeadlineTime = (get-date -Hour 20 -Minute 0 -Second 0).AddDays(10)
 $NewScheduleDeadline = New-CMSchedule -Start $DeadlineTime -Nonrecurring
 New-CMPackageDeployment -CollectionName "collection name here" -PackageName "package name here" -StandardProgramName "package program name" -DeployPurpose required -AvailableDateTime "2020-12-10 13:00" -StandardProgram -FastNetworkOption DownloadContentFromDistributionPointAndRunLocally -SlowNetworkOption DownloadContentFromDistributionPointAndLocally -RerunBehavior RerunIfFailedPreviousAttempt -Schedule $NewScheduleDeadline
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks @AllenLiu-MSFT ,

With some more modifications, I was able to deploy the software package.

Thank you for your assistance.


0 Votes 0 ·
VikramMidha-0394 avatar image
0 Votes"
VikramMidha-0394 answered

@AllenLiu-MSFT

or

anyone?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered VikramMidha-0394 edited

@VikramMidha-0394
Thank you for posting in Microsoft Q&A forum.
You need the parameter -StandardProgram with your command.
New-CMPackageDeployment -CollectionName "collection name here" -PackageName "package name here" -StandardProgramName "package program name" -DeployPurpose Required -AvailableDateTime "2020-12-10 13:00" -StandardProgram

And schedule must be set for "required" deploypurpose.
https://docs.microsoft.com/en-us/powershell/module/configurationmanager/new-cmpackagedeployment?view=sccm-ps#example-4--with-required-schedule--deadline-in-10-days


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AllenLiu-MSFT

tried your suggestion, and modified the command syntax as below

Set-CMPackageDeployment -CollectionName "collection name here" -PackageName "package name here" -StandardProgramName "package program name" -DeployPurpose Required -DeploymentAvailableDateTime "2020-12-10 13:00" -StandardProgram


however, unsure how to integrate and use -schedule.
have checked the link you suggested but unable to integrate appropriately

Is there a possibility that you could provide a reference script for this?

0 Votes 0 ·
Jason-MSFT avatar image
0 Votes"
Jason-MSFT answered Jason-MSFT commented

To create a deployment, you need to use New-CMPackageDeployment.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello Jason,

I tried to use New-CMPackageDeployment but It shows up same error

0 Votes 0 ·

See @AllenLiu-MSFT's comments.

0 Votes 0 ·