PowerShell DSC EXE ProductID And Name


PowerShell DSC can install EXEs with its Package resource:

Package MyPackage {
    Name = [string]
    Path = [string]
    ProductId = [string]

Path is easy, it’s just the path to the installer. But what goes in Name or ProductID?

Let’s use WinRAR as an example. You shouldn’t actually install this with DSC, you should use Chocolatey, but I needed something to demo.

There are lots of instructions for finding the product ID for MSIs, like Sam Cogan’s, but they don’t work for EXEs. After reading tons of sources that weren’t solid enough to link, I figured out that EXEs don’t have a product ID. Just the empty string: ''.

The name was trickier. For WinRAR it’s WinRAR, right? Nope. DSC throws errors:

powershell.exe : PowerShell DSC resource MSFT_PackageResource  failed to execute Set-TargetResource functionality 
    + CategoryInfo          : NotSpecified: (PowerShell DSC ... functionality :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
with error message: Package from C:\winrar-x64-561.exe was installed, but the specified ProductId 
and/or Name does not match package details 
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName        : localhost

Turns out you can find the name DSC needs by doing a temp install of the app by hand (I used a Vagrant box) and then checking its entry in “Add or remove programs” in the system settings:


The Name is the full WinRAR 5.61 (64-bit), including the spaces and special characters.

Here’s the full DSC resource:

Package WinRAR {
    Name = 'WinRAR 5.61 (64-bit)'
    Path = "$Env:SystemDrive\winrar-x64-561.exe"
    ProductId = ''
    Arguments = '/S'

(The /S stops the installer from asking for user input)

That’s it! Use empty string for the product ID and look up the name in “Add or remove programs” and you’re good to go.

Happy automating,


Need more than just this article? We’re available to consult.

You might also want to check out these related articles: