remote PCs using get-msiproductinfo

Aug 10, 2007 at 2:57 AM

I'm curious, are you planning on adding the ability to grade the MSI info from remote boxes?

Feb 11, 2008 at 8:46 AM
Windows Installer APIs do not support remote calls, however remoting is planned for PowerShell v2.0 (see to sign up for pre-releases) and you could use WMI currently to query the Win32_Product class like so,

get-wmiobject -class Win32_Product -computername {remote computer name}
Jul 25, 2013 at 10:37 AM
Be aware of the following if you do use win32_product:
Jul 25, 2013 at 11:46 AM
Here's an example of running it remotely, you copy the folder to the temp directory on the remote machine, invoke the command remotely, then delete the remote folder, this has to be done as a separate job as the Windows Installers will have been loaded in the app domain. I do this as a job as I don't need to wait for it to complete.

    write-verbose "Starting: $($MyInvocation.MyCommand)"

    $scriptFolder   = Split-Path -Parent $MyInvocation.MyCommand.Path
    $moduleName     = "MSI"
    $modulePath     = Join-Path -Path $scriptFolder -ChildPath $moduleName  

    $remoteScript   = {
        Import-Module $targetPath

    $delayedDelete  = {
        Remove-Item -Path $path -Force -Recurse
    $remotePath = "\\$computerName\c$\temp\$moduleName"
    write-verbose "Copying module to $remotePath"
    Copy-Item -Path $modulePath -Destination $remotePath -Recurse -Container -Force

    write-verbose "Getting installed products"
    $products = Invoke-Command -ComputerName $computerName -ScriptBlock $remoteScript -ArgumentList "c:\temp\$moduleName"
    write-verbose "$($products.length) Products found"
    write-verbose "Starting job to delete $remotePath"
    Start-Job -ScriptBlock $delayedDelete -ArgumentList $remotePath | Out-Null

    write-verbose "Complete: $($MyInvocation.MyCommand)"
Marked as answer by heaths on 10/3/2013 at 2:17 PM