MSI Installation parameters for DSC Package Resource

Hi

I have to install a .msi package through Azure ARM template.There are several parameter inputs that need to be provided during installation. How do we achieve this using Package resource of DSC? How to provide these inputs?

Please provide the answer.

Regards
Sumit Verma

You can provide those with the arguments parameter. Like so:

$OMSArgs = '/C:"setup.exe /qn ADD_OPINSIGHTS_WORKSPACE=1 '+  "OPINSIGHTS_WORKSPACE_ID=$OMSWorkspaceID " + "OPINSIGHTS_WORKSPACE_KEY=$OMSWorkspaceKey " +'AcceptEndUserLicenseAgreement=1"'


    xPackage OMSInstall {
        Ensure = "Present"
        Path  = $OMSPackageLocalPath
        Name = "Microsoft Monitoring Agent"
        ProductId = ""
        Arguments = $OMSArgs
        DependsOn = "[xRemoteFile]OMSPackage"
    }

Thanks for providing the steps. I will implement it and if I face any issue then I will let you know.

Regards
Sumit Verma

Hi

How do we know the arguments name of a given .msi file e.g. in the example that you provided, you used ADD_OPINSIGHTS_WORKSPACE, OPINSIGHTS_WORKSPACE_ID etc. How do we get these names from a .msi file. Is there any powershell command for this.

Regards…

Hi,
Sometime, the package you try to install exists in Chocolatey (you can browse packages here: Chocolatey Software | Packages).
If you find your package, you can have a look at setup script in th package page (Files section). You may find somthing like:

$install_options = '/s '
    if ($params.static -ne $false) {
        $install_options += 'STATIC=1 '
    }
    if ($params.installdir -ne $null) {
        $install_options += 'INSTALLDIR=' + $params.installdir + ' '
    }
 
    $install_options += 'ADDLOCAL="ToolsFeature'
    if ($params.source -ne $false) {
        $install_options += ',SourceFeature'
    }

That’s some of identified parameters…
BTW, the package provider may have a support/documentation page that lists these parameters.