Repository: microsoft/PowerToys
File: src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs (C#)

Code before:
                    pair.Metadata.IsEnabledPolicyConfigured = true;
                    Log.Info($"The plugin <{pair.Metadata.Name}> is disabled by policy.", typeof(PluginManager));
                }
                else if (enabledPolicyState == GpoRuleConfigured.WrongValue)
                {
                    Log.Warn($"Wrong policy value for enabled policy for plugin <{pair.Metadata.Name}>.", typeof(PluginManager));
                }

                if (pair.Metadata.Disabled)
                {
                    return;
                }

                pair.InitializePlugin(API);

                if (!pair.IsPluginInitialized)
                {
                    failedPlugins.Enqueue(pair);
                }
            });

            _contextMenuPlugins = GetPluginsForInterface<IContextMenu>();

            if (!failedPlugins.IsEmpty)
            {
                var failed = string.Join(",", failedPlugins.Select(x => x.Metadata.Name));
                var description = $"{string.Format(CultureInfo.CurrentCulture, FailedToInitializePluginsDescription, failed)}\n\n{Resources.FailedToInitializePluginsDescriptionPartTwo}";
                Application.Current.Dispatcher.InvokeAsync(() => API.ShowMsg(Resources.FailedToInitializePluginsTitle, description, string.Empty, false));
            }
        }

        public static List<Result> QueryForPlugin(PluginPair pair, Query query, bool delayedExecution = false)
        {
            ArgumentNullException.ThrowIfNull(pair);

            if (!pair.IsPluginInitialized)
            {
                return new List<Result>();
            }

            if (string.IsNullOrEmpty(query.ActionKeyword) && string.IsNullOrWhiteSpace(query.Search))
            {
                return new List<Result>();
            }

            try
            {
                List<Result> results = null;
                var metadata = pair.Metadata;
                var milliseconds = Wox.Infrastructure.Stopwatch.Debug($"PluginManager.QueryForPlugin - Cost for {metadata.Name}", () =>
                {

Review comment (bug):
```suggestion
                var failed = string.Join(", ", failedPlugins.Select(x => x.Metadata.Name));
```

Saw it too late.


Code after:
                    pair.Metadata.IsEnabledPolicyConfigured = true;
                    Log.Info($"The plugin <{pair.Metadata.Name}> is disabled by policy.", typeof(PluginManager));
                }
                else if (enabledPolicyState == GpoRuleConfigured.WrongValue)
                {
                    Log.Warn($"Wrong policy value for enabled policy for plugin <{pair.Metadata.Name}>.", typeof(PluginManager));
                }

                if (pair.Metadata.Disabled)
                {
                    return;
                }

                pair.InitializePlugin(API);

                if (!pair.IsPluginInitialized)
                {
                    failedPlugins.Enqueue(pair);
                }
            });

            _contextMenuPlugins = GetPluginsForInterface<IContextMenu>();

            if (!failedPlugins.IsEmpty)
            {
                var failed = string.Join(", ", failedPlugins.Select(x => x.Metadata.Name));
                var description = $"{string.Format(CultureInfo.CurrentCulture, FailedToInitializePluginsDescription, failed)}\n\n{Resources.FailedToInitializePluginsDescriptionPartTwo}";
                Application.Current.Dispatcher.InvokeAsync(() => API.ShowMsg(Resources.FailedToInitializePluginsTitle, description, string.Empty, false));
            }
        }

        public static List<Result> QueryForPlugin(PluginPair pair, Query query, bool delayedExecution = false)
        {
            ArgumentNullException.ThrowIfNull(pair);

            if (!pair.IsPluginInitialized)
            {
                return new List<Result>();
            }

            if (string.IsNullOrEmpty(query.ActionKeyword) && string.IsNullOrWhiteSpace(query.Search))
            {
                return new List<Result>();
            }

            try
            {
                List<Result> results = null;
                var metadata = pair.Metadata;
                var milliseconds = Wox.Infrastructure.Stopwatch.Debug($"PluginManager.QueryForPlugin - Cost for {metadata.Name}", () =>
                {