mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Refactor to eliminate global variable dependencies
Removes the use of global variables for paths and architecture settings. Instead, these values are now passed explicitly as parameters to the relevant functions. This change improves code clarity, reduces the risk of side effects, and makes the functions more modular and easier to test.
This commit is contained in:
@@ -153,13 +153,6 @@ function Invoke-ParallelProcessing {
|
||||
# Set the log path for this parallel thread
|
||||
Set-CommonCoreLogPath -Path $localJobArgs['_currentLogFilePathForJob']
|
||||
|
||||
# Set other global variables if tasks rely on them (prefer passing as parameters)
|
||||
$global:AppsPath = $localJobArgs['AppsPath']
|
||||
$global:WindowsArch = $localJobArgs['WindowsArch']
|
||||
if ($localJobArgs.ContainsKey('OrchestrationPath')) {
|
||||
$global:OrchestrationPath = $localJobArgs['OrchestrationPath']
|
||||
}
|
||||
|
||||
# Execute the appropriate background task based on $localTaskType
|
||||
switch ($localTaskType) {
|
||||
'WingetDownload' {
|
||||
|
||||
Reference in New Issue
Block a user