winutil
winutil copied to clipboard
Initialize-InstallAppEntry.ps1 throws null-reference errors for every rendered app card ($Apps.$appKey should be $app)
Problem
Every app-card render on the Install tab throws:
InvalidOperation: ...\winutil.ps1:954
954 | $fallback.Text = $Apps.$appKey.content.TrimStart(".").Substri …
| You cannot call a method on a null-valued expression.
repeated once per app card, flooding the console.
Cause
functions/private/Initialize-InstallAppEntry.ps1 computes $app = $sync.configs.applicationsHashtable.$appKey early in the function, but 4 later references still use the stale/out-of-scope $Apps.$appKey (capital A) instead of the local $app: lines 72, 74, 78, and 81.
Existing test coverage
The repo's own Pester suite already covers this exact scoping bug and it's currently failing on main: pester/install-rendering.Tests.ps1 -> "Install app rendering startup contract - keeps app-entry metadata lookup independent from the old caller scope".
Suggested fix
Replace the 4 $Apps.$appKey references with $app in Initialize-InstallAppEntry.ps1.