Files
winutil/pester
d32efebac6 Fix Show Installed Apps missing the app with the widest winget name (#5153)
* Fix Show Installed Apps missing the widest winget name

winget pads each column of `winget list` to its widest value plus one
space, so the row with the widest Name has a single space before its
Id. The installed-app pattern required two or more, so that app was
never ticked; for example vc2015_64/vc2015_32 when the VC++ v14
runtimes have the longest names.

Require only one whitespace character on each side of the ID instead
of two. There is still no start-of-line alternative, so an ID still
cannot match at the start of a Name. Add a Pester case where the
target app has the widest Name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Only accept a one-space winget Id at the Id column

Loosening the pattern to one whitespace character let an ID match a
word inside another package's Name, so "Some Git.Git Tool" ticked Git.

Restore the original two-space pattern unchanged, so everything main
matched still matches. Also accept the ID when it starts exactly at
the Id column, taken from the header line above the dashes. That
still catches the row with the widest Name or Id, cannot match inside
an ASCII Name, and skips rows whose Name has combining marks or emoji,
which are more characters than columns. The lookbehind keeps Windows
PowerShell 5.1 as fast as main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Cover widest WinGet IDs in both package manager modes

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2026-10-21 15:23:29 -05:00
..