Includes exit code fields when using Copy Apps button

Adds persistence of AdditionalExitCodes and IgnoreNonZeroExitCodes when exporting the UI list to prevent losing custom exit handling settings and maintain parity with the primary save routine.
This commit is contained in:
rbalsleyMSFT
2025-09-16 17:05:34 -07:00
parent cb14e84a26
commit f37647599a
@@ -396,8 +396,8 @@ function Invoke-CopyBYOApps {
try { try {
# Ensure items are sorted by current priority before saving # Ensure items are sorted by current priority before saving
# Exclude CopyStatus when saving and ensure Priority is an integer # Exclude CopyStatus when saving and ensure Priority is an integer; include AdditionalExitCodes and IgnoreNonZeroExitCodes for parity with Save-BYOApplicationList
$applications = $listView.Items | Sort-Object Priority | Select-Object @{N = 'Priority'; E = { [int]$_.Priority } }, Name, CommandLine, Arguments, Source $applications = $listView.Items | Sort-Object Priority | Select-Object @{N = 'Priority'; E = { [int]$_.Priority } }, Name, CommandLine, Arguments, Source, AdditionalExitCodes, IgnoreNonZeroExitCodes
$applications | ConvertTo-Json -Depth 5 | Set-Content -Path $userAppListPath -Force -Encoding UTF8 $applications | ConvertTo-Json -Depth 5 | Set-Content -Path $userAppListPath -Force -Encoding UTF8
WriteLog "Successfully updated UserAppList.json with all applications from the UI." WriteLog "Successfully updated UserAppList.json with all applications from the UI."
} }