diff --git a/src/modules/launcher/PowerLauncher.Telemetry/Events/PluginModel.cs b/src/modules/launcher/PowerLauncher.Telemetry/Events/PluginModel.cs index 44fe14b8a31e..2034252df3ba 100644 --- a/src/modules/launcher/PowerLauncher.Telemetry/Events/PluginModel.cs +++ b/src/modules/launcher/PowerLauncher.Telemetry/Events/PluginModel.cs @@ -9,6 +9,10 @@ namespace PowerLauncher.Telemetry.Events [EventData] public class PluginModel { + public string ID { get; set; } + + public string Name { get; set; } + public bool Disabled { get; set; } public bool IsGlobal { get; set; } diff --git a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs index bfbfcb13fe00..74e735617f20 100644 --- a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs +++ b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs @@ -52,16 +52,27 @@ public MainWindow(PowerToysRunSettings settings, MainViewModel mainVM) private void SendSettingsTelemetry() { - Log.Info("Send Run settings telemetry", this.GetType()); - var plugins = PluginManager.AllPlugins.ToDictionary(x => x.Metadata.Name, x => new PluginModel() + try { - Disabled = x.Metadata.Disabled, - ActionKeyword = x.Metadata.ActionKeyword, - IsGlobal = x.Metadata.IsGlobal, - }); - - var telemetryEvent = new RunPluginsSettingsEvent(plugins); - PowerToysTelemetry.Log.WriteEvent(telemetryEvent); + Log.Info("Send Run settings telemetry", this.GetType()); + var plugins = PluginManager.AllPlugins.ToDictionary(x => x.Metadata.Name + " " + x.Metadata.ID, x => new PluginModel() + { + ID = x.Metadata.ID, + Name = x.Metadata.Name, + Disabled = x.Metadata.Disabled, + ActionKeyword = x.Metadata.ActionKeyword, + IsGlobal = x.Metadata.IsGlobal, + }); + + var telemetryEvent = new RunPluginsSettingsEvent(plugins); + PowerToysTelemetry.Log.WriteEvent(telemetryEvent); + } +#pragma warning disable CA1031 // Do not catch general exception types + catch (Exception ex) +#pragma warning restore CA1031 // Do not catch general exception types + { + Log.Exception("Unhandled exception when trying to send PowerToys Run settings telemetry.", ex, GetType()); + } } protected override void OnSourceInitialized(EventArgs e)