PowerShell DSC – Package ID unknown? Not a problem!

With PowerShell Desired State Configuration you’re able to install a package with the Package resource.
However, you’ll need to provide a package ID.
In the past I either created a snapshot of a VM, installed the application and dove in the registry to find the package id.
You could also install ORCA and use that to extract the package ID from the package.

Recently I noticed that PowerShell DSC has a nice little improvement which was introduced somewhere along the line.
When you try and install a package with a faulty package ID in your script, you’ll get an error back from PowerShell stating that
the package ID didn’t match the one found in the package… and stating the package id found inside the package!!!

So, copy-paste the package id from the error message into the DSC configuration and voilá… you’re set to go! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *