Added new $state object and refactored code to use the $state reference instead.

- 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.
This commit is contained in:
rbalsleyMSFT
2025-06-07 17:36:30 -07:00
parent 1b5fa5129c
commit 11084f6689
4 changed files with 917 additions and 846 deletions
+2 -2
View File
@@ -4316,7 +4316,7 @@ if ($InstallApps) {
if (-Not $MSRTDownloaded) {
# Create the search string for MSRT based on Windows architecture and release
if ($WindowsArch -eq 'x64') {
if ($installationType -eq 'client' -and $isLTSC -eq $false) {
if ($installationType -eq 'client' -and (-not $isLTSC)) {
$Name = """Windows Malicious Software Removal Tool x64""" + " " + """Windows $WindowsRelease"""
}
# Handle LTSB/LTSC
@@ -4339,7 +4339,7 @@ if ($InstallApps) {
WriteLog "Creating $MSRTPath"
New-Item -Path $MSRTPath -ItemType Directory -Force | Out-Null
}
WriteLog "Searching for $Name from Microsoft Update Catalog and saving to $MSRTPath"
WriteLog "Getting Windows Malicious Software Removal Tool URL"
$MSRTFileName = Save-KB -Name $Name -Path $MSRTPath
WriteLog "Latest Windows Malicious Software Removal Tool saved to $MSRTPath\$MSRTFileName"