Get-MSITable

Synopsis

Selects records from a table or custom query from a product or patch package.

Syntax

Get-MSITable [[-Path] <string[]>] -Table <string> [<CommonParameters>]

Get-MSITable -LiteralPath <string[]> -Query <string> [<CommonParameters>]

Get-MSITable -LiteralPath <string[]> -Table <string> [<CommonParameters>]

Get-MSITable [[-Path] <string[]>] -Query <string> [<CommonParameters>]

Description

You can query all records from a table or records matching a custom query from a product or patch package. The Windows Installer SDK has more information about custom queries, since the SQL-like syntax is rather constrained.

Records are returned with properties matching column names. If records are selected from a single table, the table name is also part of the type name queryable from the PSTypeNames object property.

Note that patch packages do not typically have more than a couple of tables. The patch has to be applied to a product package to view any changes it has made.

Parameters

-LiteralPath <string[]>

The path to a product package to open. The value of -LiteralPath is used exactly as typed. No characters are interpreted as wildcards.

Required? true
Position named
Default value|
Accepts pipeline input? true (ByPropertyName)
Accept wildcard charactrs? false

-Path <string[]>

The path to a product package to open. Wildcards are permitted. You can specify * in any part of the path to select all matching files.

Required? false
Position 0
Default value|
Accepts pipeline input? true (ByValue, ByPropertyName)
Accept wildcard charactrs? true

-Query <String>

A custom query for which records are selected.

Required? true
Position named
Default value|
Accepts pipeline input? false
Accept wildcard charactrs? false

-Table <String>

The table from which all records are selected.

Required? true
Position named
Default value|
Accepts pipeline input? false
Accept wildcard charactrs? false

Outputs

  • Microsoft.Tools.WindowsInstaller.Record: Selected records for a table or custom query where properties match column names.

Examples

Example 1

get-msitable .\example.msi -table Property

Gets all records from the Property table.

Example 2

$productCode = get-msitable .\example.msi -table Property | where-object { $_.Property -eq "ProductCode" } | select-object -expand Value

Selects just the ProductCode property from the example.msi package and assigns the value to a variable.

Example 3

get-childitem -filter *.msi | get-table -query "SELECT ComponentId, FileName, FileSize FROM Component, File WHERE Component_ = Component"

Selects the component GUID, file name, and file size for all files in all packages in the current directory.

Last edited Jun 11, 2013 at 9:40 AM by heaths, version 2

Comments

No comments yet.