mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor: Move Winget download logic to core module
Extracts the Winget app download logic from the main UI script into a new `Invoke-WingetDownload` function within the core Winget module. This change decouples the UI event handling from the business logic, improving modularity and maintainability. It also introduces more robust error handling for the download process by wrapping the logic in a try/catch block.
This commit is contained in:
@@ -423,6 +423,13 @@ function Register-EventHandlers {
|
||||
-PostClearAction $postClearScriptBlock
|
||||
})
|
||||
|
||||
$State.Controls.btnDownloadSelected.Add_Click({
|
||||
param($eventSource, $routedEventArgs)
|
||||
$window = [System.Windows.Window]::GetWindow($eventSource)
|
||||
$localState = $window.Tag
|
||||
Invoke-WingetDownload -State $localState -Button $eventSource
|
||||
})
|
||||
|
||||
# M365 Apps/Office tab Event
|
||||
$State.Controls.chkInstallOffice.Add_Checked({
|
||||
param($eventSource, $routedEventArgs)
|
||||
|
||||
Reference in New Issue
Block a user