diff --git a/src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs b/src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs index 4e6bcce..3082b46 100644 --- a/src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs +++ b/src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs @@ -245,7 +245,8 @@ await batch.AddBatchRequestStepAsync(graphServiceClient.DeviceAppManagement.Mobi { if (assignment.Intent == GraphModels.InstallIntent.Available && assignment.Settings is null) { - //assignment.Settings = new GraphModels.Win32LobAppAssignmentSettings { AutoUpdateSettings = new GraphModels.Win32LobAppAutoUpdateSettings { AutoUpdateSupersededApps = GraphModels.Win32LobAppAutoUpdateSupersededApps.Enabled } }; + assignment.Settings = new GraphModels.Win32LobAppAssignmentSettings { Notifications = GraphModels.Win32LobAppNotification.ShowReboot }; + assignment.Settings.AdditionalData.Add("autoUpdateSettings", new Win32LobAppAutoUpdateSettings()); } } diff --git a/src/WingetIntune/Graph/GraphWorkflows.cs b/src/WingetIntune/Graph/GraphWorkflows.cs index 4a9ad6d..c97d025 100644 --- a/src/WingetIntune/Graph/GraphWorkflows.cs +++ b/src/WingetIntune/Graph/GraphWorkflows.cs @@ -70,7 +70,8 @@ private static List GenerateAssignments(string[] groups, In MobileAppAssignmentSettings? settings = null; if (intent == InstallIntent.Available && addSetting) { - //settings = new Win32LobAppAssignmentSettings { AutoUpdateSettings = new Win32LobAppAutoUpdateSettings { AutoUpdateSupersededApps = Win32LobAppAutoUpdateSupersededApps.Enabled } }; + settings = new Win32LobAppAssignmentSettings { Notifications = Win32LobAppNotification.ShowReboot }; + settings.AdditionalData.Add("autoUpdateSettings", new Win32LobAppAutoUpdateSettings()); } if (groups is not null && groups.Any()) { diff --git a/src/WingetIntune/Graph/Win32LobAppAutoUpdateSettings.cs b/src/WingetIntune/Graph/Win32LobAppAutoUpdateSettings.cs new file mode 100644 index 0000000..585e1a9 --- /dev/null +++ b/src/WingetIntune/Graph/Win32LobAppAutoUpdateSettings.cs @@ -0,0 +1,17 @@ +using Microsoft.Graph.Beta.Models; + +namespace WingetIntune.Graph; +public class Win32LobAppAutoUpdateSettings : Entity +{ + public Win32LobAppAutoUpdateSettings() + { + base.OdataType = "microsoft.graph.win32LobAppAutoUpdateSettings"; + AutoUpdateSupersededAppsState = "enabled"; + } + + public string? AutoUpdateSupersededAppsState + { + get => BackingStore?.Get("autoUpdateSupersededAppsState"); + set => BackingStore?.Set("autoUpdateSupersededAppsState", value); + } +}