From e639cee4eeeed7d777c21cb5cd814a774e40228c Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:28:09 -0700 Subject: [PATCH] Prevents adding duplicate application names Adds a validation check to ensure application names are unique. If a user attempts to add an application with a name that already exists, a warning message is displayed, and the operation is cancelled. --- FFUDevelopment/FFUUI.Core/FFUUI.Core.Applications.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Applications.psm1 b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Applications.psm1 index 2a307a1..d833f70 100644 --- a/FFUDevelopment/FFUUI.Core/FFUUI.Core.Applications.psm1 +++ b/FFUDevelopment/FFUUI.Core/FFUUI.Core.Applications.psm1 @@ -57,6 +57,12 @@ function Add-BYOApplication { return } $listView = $State.Controls.lstApplications + # Check for duplicate names + $existingApp = $listView.Items | Where-Object { $_.Name -eq $name } + if ($existingApp) { + [System.Windows.MessageBox]::Show("An application with the name '$name' already exists.", "Duplicate Name", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) + return + } $priority = 1 if ($listView.Items.Count -gt 0) { $priority = ($listView.Items | Measure-Object -Property Priority -Maximum).Maximum + 1