I wrote this script in order to extract MSP files from CAB files. The purpose of this in my case was to get Office updates that already existed in SCCM and to put their MSP files into the Office installation folder’s “updates” directory in order to have the updates automatically installed when Office is installed.
There are a few scripts online that do this already, but they are much more complicated since they dig in to the SCCM database and download the CAB files from the management point themselves, among other unnecessary (in my case) tasks. I wanted a simpler script that I could run on my own machine rather than the SCCM server for security reasons, so I came up with this PowerShell script that does just that, including renaming the files to match their KB numbers.
The script requires an “msp” folder and an “updates” folder to reside in the same directory as the script. Since this script is run locally, you need to have the CAB files already on your computer. The CAB files from SCCM do not need to be moved out of their respective folders – you can simply copy them as-is from your SCCM updates folder. This means your “updates” folder in the script directory can have folders inside of it, and those folders will have the CAB files. Once complete, the extracted MSP files will all be together in the “msp” folder, ready to copy to your Office installation’s “updates” directory.
Here is the script: