Moves the logic for the initial population of the Windows settings comboboxes from the UI's loaded event handler into the `Initialize-UIDefaults` function.
This change centralizes UI default value setup into a single location, improving code organization and maintainability.
Moves the VM Switch data population and event handler logic from the main UI script into the `FFUUI.Core.Initialize` module.
This change improves code organization by centralizing UI initialization and event registration into dedicated functions, making the main script cleaner.
It also simplifies module manifests by changing explicit function exports to a wildcard.
Renames the function for populating Windows settings UI controls to better reflect its purpose.
The `Get-` verb more accurately describes the function's action of retrieving information from the ISO file, as opposed to the previous `Initialize-` verb.
Extracts the logic for setting default UI control values from the main script into a new `Initialize-UIDefaults` function within the `FFUUI.Core` module.
This change cleans up the main UI script's window loaded event, improving code organization and separating UI setup from default value initialization.
Replaces `$window.FindName` with `$script:uiState.Controls` for accessing UI elements.
This change simplifies how UI controls are referenced, making the code easier to read and maintain.
Renames functions for better semantic clarity:
- `Refresh-WindowsSettingsCombos` becomes `Initialize-WindowsSettingsCombos` to better reflect its role in initial UI setup.
- `Filter-DriverModels` becomes `Search-DriverModels` to more accurately describe its use in user-driven model searches.
Enhances code readability in the UI script through consistent formatting of event handlers and multi-line script blocks.
Moves initialization logic for several list views (driver models, Winget results, app script variables) and the features grid into a new `Initialize-DynamicUIElements` function.
This centralizes the setup of these UI components within the `FFUUI.Core.Initialize` module, improving code structure.
Additionally:
- Updates sort event handlers in the new module to correctly retrieve UI state from the window's tag.
- Enhances `Invoke-ListViewSort` by initializing sort state flags if they are not already present, improving sorting stability.
Extracts the UI control initialization functionality from the main core script into a dedicated module.
This improves code organization and modularity.
The module manifest is updated to include this new initialization module.
Cleans up the driver selection UI script by removing comments that were redundant, self-explanatory, or no longer relevant.
This enhances code readability and maintainability without altering functionality.
Moves ListView item manipulation functions (`Update-ListViewPriorities`, `Move-ListViewItemTop`, `Move-ListViewItemUp`, `Move-ListViewItemDown`, `Move-ListViewItemBottom`) from the `FFUUI.Core.Applications` module to the `FFUUI.Core.Shared` module.
This improves code organization and reusability by centralizing common UI helper logic.
Moves UI configuration loading and retrieval logic into a new `FFUUI.Core.Config` module.
Removes the `Set-UIValue` helper function from `BuildFFUVM_UI.ps1` and the `Get-UIConfig` function from `FFUUI.Core.psm1`.
This centralizes UI-related configuration handling for improved modularity.
Moves functions and static data related to Windows releases, versions, SKUs, and optional features from the main UI script and core module into a new, dedicated `FFUUI.Core.WindowsSettings` module.
This change enhances code organization and modularity by centralizing Windows-specific configuration and UI helper functions. The UI script is updated to reflect these changes, including passing state to the refactored `BuildFeaturesGrid` function.
Moves ListView manipulation, BYO application import/export, and copy task logic from the main UI script and core UI module into a new `FFUUI.Core.Applications` module.
This improves code organization and modularity for application-related features.
Extracts Winget-related functionalities, including search, list management, installation, and download tasks, from `BuildFFUVM_UI.ps1` and `FFUUI.Core.psm1`.
Consolidates these features into a new module, `FFUUI.Core.Winget.psm1`, to improve code organization and maintainability.
Relocates driver-specific download, parsing, and management logic from the main UI script and the FFUUI.Core module into new, dedicated modules for each manufacturer (Dell, HP, Lenovo, Microsoft). This improves modularity and code organization.
Additionally, centralizes common HTTP headers and user agent strings in the FFUUI.Core module, accessible via a new helper function.
- Created module manifest for FFU.Common with initial version 0.0.1.
- Created module manifest for FFUUI.Core with initial version 0.0.1.
- Implemented shared UI functions in FFUUI.Shared.psm1, including:
- Update-ListViewItemStatus: Updates the status of items in a ListView.
- Update-OverallProgress: Updates a progress bar and status label.
- Invoke-ProgressUpdate: Enqueues progress updates to the UI thread.
- Add-SortableColumn: Adds sortable columns to a ListView.
- Add-SelectableGridViewColumn: Adds a selectable column with a "Select All" checkbox.
- Update-SelectAllHeaderCheckBoxState: Updates the state of the header checkbox.
- Invoke-ListViewSort: Sorts ListView items based on specified properties.
- Show-ModernFolderPicker: Displays a modern folder picker dialog.
- Introduced the Initialize-UIControls function to streamline the assignment of UI control references to the centralized state object.
- Removed repetitive control assignments from the window loading event, enhancing maintainability and readability.
- Improved the overall structure of the UI initialization process for better consistency across the application.
Refactor functions to use a centralized state object
Modifies various functions to accept and utilize a `$State` parameter, replacing direct access to `$script:uiState` and module-scoped variables.
This change centralizes state management, improving code consistency and maintainability by passing necessary UI elements, data, and default configurations explicitly.
- Updated functions to accept a State parameter for improved scope management.
- Replaced direct window control access with State object references for better encapsulation and consistency.
- Ensured proper handling of UI elements within the context of the State object.
Refactors UI functions to use a State parameter
Improves scope management and encapsulation by passing a `State` object to UI-interacting functions.
This change modifies several functions, including `Get-ModelsForMake` and `Update-CopyButtonState`, to accept a `State` parameter.
It replaces direct access to UI controls via `$window.FindName` with references from the `State` object, leading to more consistent and maintainable code.
- Moved the UpdateInstallAppsBasedOnUpdates function to the Controls section of the uiState object for better encapsulation.
- Updated the function to accept a state parameter, reducing reliance on the script scope.
- Adjusted event handlers to pass the state object, ensuring consistent access to UI state.
- Removed the previous definition of the function from the script scope to streamline the code.
The comment explaining how the Windows SKU combo box's ItemsSource is populated was outdated. It incorrectly stated that the `Update-WindowsSkuCombo` function was called via `RefreshWindowsSettingsCombos`.
This change removes the inaccurate reference, clarifying that `Update-WindowsSkuCombo` is now called directly.
- Moved Get-UIConfig from BuildFFUVM_UI.ps1 to FFUUI.Core.psm1 to enhance separation of concerns.
- Updated Get-UIConfig to accept a central $State object, removing direct dependencies on global UI variables.
- Modified internal logic to access UI control values from the $State.Controls hashtable.
- Updated calls in BuildFFUVM_UI.ps1 to pass the $script:uiState object to the refactored function.
- Exported Get-UIConfig from FFUUI.Core.psm1 for accessibility in the main UI script.
- Updated Update-WindowsSkuCombo function to derive selected release value and display name from the ComboBox, removing the need for parameters.
- Enhanced logging to include display names for better traceability.
- Corrected SKU values for Windows 10 LTSB 2016 and LTSC 2019 in the release mappings.
- Adjusted Get-AvailableSkusForRelease function to handle specific cases for LTSB 2016 and LTSC 2019, ensuring accurate SKU retrieval.
- Introduced a new function `Get-AvailableSkusForRelease` to retrieve available SKUs based on the selected Windows release value.
- Added a new function `Update-WindowsSkuCombo` to refresh the SKU ComboBox in the UI when the release changes.
- Updated the SKU lists for various Windows versions, including client and server SKUs, as well as LTSC editions.
- Modified the `RefreshWindowsSettingsCombos` function to call the new SKU update function.
- Ensured that the SKU ComboBox is populated dynamically based on the selected release, improving user experience and accuracy.
- Expanded the list of allowed SKUs to include 'Enterprise 2016 LTSB', 'Enterprise N 2016 LTSB', 'Enterprise LTSC', 'Enterprise N LTSC', 'IoT Enterprise LTSC', and 'IoT Enterprise N LTSC'.
- Updated the list of all Windows releases to include 'Windows 10 LTSC 2021' and 'Windows 10 LTSC 2024'.
- Modified the Windows version map to include version mappings for LTSC 2021 and LTSC 2024.
- Enhanced logic to determine the initial directory for the SaveFileDialog based on the parent directory of the path in the txtDriversJsonPath TextBox.
- Added error handling and logging for cases where the path is invalid or empty, ensuring the dialog defaults to its standard behavior when necessary.
- Improved user feedback by logging actions related to the selection or cancellation of the SaveFileDialog.
- Introduced a new TextBox and Button in the UI for specifying the Drivers.json file path.
- Updated the UI layout to accommodate the new Drivers.json path input.
- Enhanced the core logic to set a default path for Drivers.json based on the Drivers folder.
- Implemented functionality to browse and select the Drivers.json file, allowing users to create or select an existing file.
- Introduced a new checkbox in the UI for removing application content in the Apps folder after FFU capture.
- Updated the Get-UIConfig function to retrieve the state of the new checkbox.
- Added default value for the new 'RemoveApps' parameter in the general defaults.
- Introduced a script-scoped list for managing Apps Script Variables data.
- Updated the ListView to bind its ItemsSource to the new data list.
- Enabled sorting for Key and Value columns in the Apps Script Variables ListView.
- Improved item addition and removal logic to interact with the data list directly.
- Ensured header checkbox state updates correctly after modifications to the data list.
- Implemented Add-SelectableGridViewColumn function to allow adding a header checkbox for selecting all items in ListViews.
- Updated the ListView setup in BuildFFUVM_UI.ps1 to utilize the new selectable column feature for driver models and winget results.
- Added IsSelected property to items in Apps Script Variables ListView for better selection management.
- Renamed button from "Remove Apps Script Variable" to "Remove Selected" for improved clarity on functionality.
- Simplified the input layout for defining Apps Script Variables by removing the grid structure.
- Added clear labels for "Key" and "Value" inputs to enhance user understanding.
- Adjusted the "Add Variable" button for better alignment and padding, improving the overall user experience.