Skip to content

Creating Software Update Deployment Packages from PowerShell

Featured Replies

Hey All.

 

I've been working on an otherwise simple runbook in Orchestrater that gathers all the auto deployment rules, checks their associated Deployment Package that they download updates to, and updates said packages to the correct "year" to help alleviate that otherwise annoying manual process of maintaining Update package sizes.

 

I ran into a final problem however: when it's time to create a "new" software update package I can't figure out any way to do it form the command line. Creating a new one from the GUI seems to only be doable by editing an existing or creating a new ADR. However, if I try to use New-CMSoftwareUpdateAutoDeploymentRule the only flag I can seem to use is -DeploymentPackageName which requires the package to have already been created.

 

More frustrating is that trying to query the cmdlets directy to manipulate the packages:

 

get-CMSoftwareUpdateDeploymentPackage

set-CMSoftwareUpdateDeploymentPackage

remove-CMSoftwareUpdateDeploymentPackage

 

huh ... no add ... no new .... no "start" even.

 

Is there anyway to create these things systematically? Perhaps even with a WMI call? My goal is to setup soem runbooks that query the current year and possibly current size of the packages and create new deployment packages when certain size limits are hit. Most of it was easy ... this last it is ... annoying.

  • Author

Bah .. sometimes the right Google query answers the question. Those curious we can make them with a WMI query:

 

$Arguments = @{Name = $Name;Description = $Description;PkgSourceFlag = 2;PkgSourcePath = $Source}

Set-WmiInstance -Namespace "Root\SMS\Site_$SiteCode" -Class SMS_SoftwareUpdatesPackage -Arguments $Arguments -ComputerName $SiteServer -ErrorAction STOP

 

In the above string I'm using variables for Name, Description, and Source Directory, as well as Site Server and site code. Now I just have to distribute that package and I'm good to go. Home stretch here I come!

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.