"An error occurred while enumerating through a collection" when running winutil
Describe the bug When running winutil 24.06.28 (before doing anything else) it shows the following error (part of the error message is in Portuguese because I'm running it in a portuguese Win 11 Pro and you have the translation in the below "Additional context" section):
=====Windows Toolbox=====
An error occurred while enumerating through a collection: A colecção foi modificada; a operação de enumeração poderá
não ser executada..
At line:589 char:5
+ $keys = ($sync.keys).where{ $_ -like "WPF*" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Collecti...tableEnumerator:HashtableEnumerator) [], RuntimeExc
eption
+ FullyQualifiedErrorId : BadEnumeration
Additional context I run it on a portuguese Windows 11 Pro 23H2 (compilation 22631.3737). The translation of the portuguese part of the error message is The collection was modified; the enumeration operation may not be executed..
This issue was marked as stale because it has been inactive for 7 days
Commenting on this issue to keep it open, please ignore this comment...
This issue was marked as stale because it has been inactive for 7 days
This issue was closed because it has been inactive for 7 days since it was marked as stale
====Chris Titus Tech===== =====Windows Toolbox===== InvalidOperation: Line | 5401 | $sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | An error occurred while enumerating through a collection: Collection was modified; enumeration operation may not execute..
--- Winget is installed ---
An error occurred while enumerating through a collection: Collection was modified; enumeration operation may not execute.. At line:770 char:5
-
$keys = ($sync.keys).where{ $_ -like "WPF*" } -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidOperation: (System.Collecti...tableEnumerator:HashtableEnumerator) [], RuntimeExc eption
- FullyQualifiedErrorId : BadEnumeration
=====Windows Toolbox=====
An error occurred while enumerating through a collection: Collection was modified; enumeration operation may not execute..
At line:399 char:5
+ $keys = ($sync.keys).where{ $_ -like "WPF*" }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Collecti...tableEnumerator:HashtableEnumerator) [], RuntimeException
+ FullyQualifiedErrorId : BadEnumeration
Key cannot be null.
Parameter name: key
At line:5908 char:13
+ $sync.$tabNav.Items[$tabNumber].IsSelected = $true
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException