A Powershell Module for SCCM Automation
The goal of this repo is to fully automate the maintaining of SCCM packages and applications. I mostly scrape the download websites directly and don't rely on 3rd Party services. All of the install binaries are downloaded directly from the vendor site.
There are three main functions Update-AppPackageSource, New-SCCMPackage, and New-SCCMApplication. The cmdlet names probally need to change to show they are related.
Update-AppPackageSoruce accepts a app name from a predfined list of about a dozen apps. It then goes out and downloads the latest version of that app from the vendor's website. It then copies the latest source files for application x and makes a new folder called "X Version# (R#)". It then deletes all the install files in the "X Version# (R#)\Files" directory and copies the new install files to that directory. It then updates the deploy-application.ps1's $appversion barible to the latest version. There are a lot of checks and error handling thrown in. The function is also pretty verbose and writes out what it is doing.
PS C:\Users\davisn1\Documents\Projects\HM-Functions> Update-AppPackageSource -App Firefox
P Drive to SCCM Exists already
Firefox 62.0.2 package is already up to date
PS C:\Users\davisn1\Documents\Projects\HM-Functions> Update-AppPackageSoruce -App Firefox -ForceUpdate
P Drive to SCCM Exists already
Forcing update of Firefox from 62.0.2 to 62.0.2
'Firefox 62.0.2 (R1)' already exists, auto incrementing the R#
Creating folder 'Firefox 62.0.2 (R2)'
Copying old package files to \\serversccm01\Packages\HOME OFFICE\Mozilla FireFox\Firefox 62.0.2 (R2)
Removing old install files
Copying new install files
VERBOSE: Performing the operation "Copy File" on target "Item: C:\Users\davisn1\Downloads\AppUpdat
es\Firefox Setup 62.0.2-32bit.exe Destination: \\serversccm01\Packages\HOME OFFICE\Mozilla FireFox\F
irefox 62.0.2 (R2)\Files\Firefox Setup 62.0.2-32bit.exe".
VERBOSE: Performing the operation "Copy File" on target "Item: C:\Users\davisn1\Downloads\AppUpdat
es\Firefox Setup 62.0.2-64bit.exe Destination: \\serversccm01\Packages\HOME OFFICE\Mozilla FireFox\F
irefox 62.0.2 (R2)\Files\Firefox Setup 62.0.2-64bit.exe".
Updating version numbers from 62.0.2 to 62.0.2
The next function is New-SCCMPackage. This function creates an SCCM package from the latest folder for a give app, makes the install program, distributes the package to DPs, moves it to a give folder in SCCM, and deploys it to a test collection.
Edit the GlobalVariablesExample.ps1 and GlobalVariblesExample.json files in project root to work with your enviroment. Rename it to GlobalVariables.ps1 and GlobalVaribles.json
SCCM-PackageAutomation requires the following Powershell Modules
For SCCM functions you also need
Note tested with SCCM 1906, not sure if it works in other versions.
These imports should be handled automatically when running the New-SCCMPackage and New-SCCMApplication functions.
Powershell App Deployment Toolkit (PSADT)
Credit to the following
MIT