Preliminary Checks
Bug Description
When the Winget-Update function in the PowerShell profile attempts to upgrade the WinGet package Blizzard.BattleNet, the operation fails with a "package version not determinable" error and returns exit code -1978335189. The package is not upgraded, and the user is left with no path forward other than manually re-running winget upgrade with extra arguments.
The failure is not exclusive to Battle.net: any package whose installed version is not properly versioned in the WinGet source triggers the same error.
Steps to Reproduce
- Install
Blizzard.BattleNet (or any package whose installed version is reported as "Unknown" by WinGet).
- Open a PowerShell session with the WinToolkit profile loaded.
- Run
Winget-Update.
- When prompted, paste
Blizzard.BattleNet as one of the package IDs to upgrade and press Enter on an empty line to start.
- Observe the upgrade attempt.
Expected: the package is upgraded (or a graceful fallback handles the unknown-version case).
Actual: the upgrade fails immediately with a version-determination error.
Expected Behavior
The function should detect packages whose installed version cannot be determined by WinGet, automatically retry the upgrade with the --include-unknown argument, and report success — matching the pattern already used for the incompatible-installation-technology reinstall flow.
Actual Behavior
🔄 Upgrading Blizzard.BattleNet...
Non è possibile determinare il numero di versione di questo pacchetto. Per aggiornarlo comunque, aggiungere l'argomento --include-unknown al comando precedente.
❌ Blizzard.BattleNet upgrade failed (code -1978335189).
### Windows OS Version
Windows 11 25H2
### PowerShell Version
PowerShell 7.4+ (Core)
### PowerShell Profile Version
2.6.0.6
### Bug Type
- [ ] This is a Windows bug caused by a specific Windows version.
### Log Attachment (Required)
- [x] I generated and attached the `.zip` log file below.
### Additional Context
- The error message contains a mojibake character (`├¿`) which is the UTF-8 byte sequence for the en-dash (`–`) being mis-decoded — minor console/locale issue, not blocking.
- Related: the same `-1978335189` exit code is already handled in `Update-Pwsh` for `Microsoft.PowerShell` (incompatible-tech reinstall flow) and could be unified with the same helper.
- Fix should be DRY: extract a `Test-WingetUnknownVersion` / `Invoke-WingetUnknownVersionRetry` pair to keep `Winget-Update` and `Update-Pwsh` consistent.
Preliminary Checks
Bug Description
When the
Winget-Updatefunction in the PowerShell profile attempts to upgrade the WinGet packageBlizzard.BattleNet, the operation fails with a "package version not determinable" error and returns exit code-1978335189. The package is not upgraded, and the user is left with no path forward other than manually re-runningwinget upgradewith extra arguments.The failure is not exclusive to Battle.net: any package whose installed version is not properly versioned in the WinGet source triggers the same error.
Steps to Reproduce
Blizzard.BattleNet(or any package whose installed version is reported as "Unknown" by WinGet).Winget-Update.Blizzard.BattleNetas one of the package IDs to upgrade and press Enter on an empty line to start.Expected: the package is upgraded (or a graceful fallback handles the unknown-version case).
Actual: the upgrade fails immediately with a version-determination error.
Expected Behavior
The function should detect packages whose installed version cannot be determined by WinGet, automatically retry the upgrade with the
--include-unknownargument, and report success — matching the pattern already used for the incompatible-installation-technology reinstall flow.Actual Behavior