APPX Software Library

Chapter 7: Read APPX Data with 32-bit PowerShell

Summarize and Check the Returned Data

Use PowerShell for a small analysis after obtaining $rows. This does not change the APPX file:

$rows | Measure-Object -Property no_words -Sum -Minimum -Maximum
$rows | Group-Object -Property { $_.region_label.TrimEnd() } |
    Sort-Object Name | Select-Object Name, Count
$rows | Where-Object { $_.no_words -ge 2 } |
    Select-Object name, no_words

For the unmodified sample, no_words sums to 9, with minimum 0 and maximum 2. There are 3 County, 1 Province, 2 State, and 1 blank region labels. The final filter returns Canada, Netherlands and UK. The grouping trims trailing padding only for the grouping key; the original $rows remain intact.

A second query can be compared with the earlier snapshot:

$again = @(.\read-appx-odbc-32.ps1 -Credential $credential)
Compare-Object -ReferenceObject $rows -DifferenceObject $again `
    -Property name, region_label, city_sep_line, no_words, post_code_loc, added_by, date_added, changed_by, date_changed

No output means the selected nine fields agree between these two ODBC reads. It does not independently prove the APPX-to-SQL mapping. The native APPX comparison remains the check for that. If APPX users change records between reads, differences can be expected.