diff --git a/functions/public/Invoke-WPFFeatureInstall.ps1 b/functions/public/Invoke-WPFFeatureInstall.ps1 index 02c37881..69aaaa9b 100644 --- a/functions/public/Invoke-WPFFeatureInstall.ps1 +++ b/functions/public/Invoke-WPFFeatureInstall.ps1 @@ -7,7 +7,7 @@ function Invoke-WPFFeatureInstall { #> param ( - $FeatureConfig + $Features ) if($sync.ProcessRunning) { @@ -16,9 +16,7 @@ function Invoke-WPFFeatureInstall { return } - if ($FeatureConfig) { - $Features = $FeatureConfig - } else { + if ([string]::IsNullOrEmpty($Features)) { $Features = (Get-WinUtilCheckBoxes)["WPFFeature"] } diff --git a/functions/public/Invoke-WPFInstall.ps1 b/functions/public/Invoke-WPFInstall.ps1 index 120ab56b..d4fc7daa 100644 --- a/functions/public/Invoke-WPFInstall.ps1 +++ b/functions/public/Invoke-WPFInstall.ps1 @@ -7,7 +7,7 @@ function Invoke-WPFInstall { #> param ( - $InstallConfig + $PackagesToInstall ) if($sync.ProcessRunning) { @@ -16,9 +16,7 @@ function Invoke-WPFInstall { return } - if ($InstallConfig) { - $PackagesToInstall = $InstallConfig - } else { + if ([string]::IsNullOrEmpty($InstallConfig)) { $PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"] } diff --git a/functions/public/Invoke-WPFtweaksbutton.ps1 b/functions/public/Invoke-WPFtweaksbutton.ps1 index 342ec04b..3d2249ee 100644 --- a/functions/public/Invoke-WPFtweaksbutton.ps1 +++ b/functions/public/Invoke-WPFtweaksbutton.ps1 @@ -7,7 +7,7 @@ function Invoke-WPFtweaksbutton { #> param ( - $TweaksConfig + $Tweaks ) if($sync.ProcessRunning) { @@ -16,9 +16,7 @@ function Invoke-WPFtweaksbutton { return } - if ($TweaksConfig) { - $Tweaks = $TweaksConfig - } else { + if ([string]::IsNullOrEmpty($Tweaks)) { $Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"] } @@ -32,8 +30,8 @@ function Invoke-WPFtweaksbutton { Write-Debug "Number of tweaks to process: $($Tweaks.Count)" - Invoke-WPFRunspace -ArgumentList $Tweaks -DebugPreference $DebugPreference -ScriptBlock { - param($Tweaks, $DebugPreference) + Invoke-WPFRunspace -ArgumentList $Tweaks, $testvar -DebugPreference $DebugPreference -ScriptBlock { + param($Tweaks, $testvar, $DebugPreference) Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)" $sync.ProcessRunning = $true diff --git a/scripts/main.ps1 b/scripts/main.ps1 index e92e1a68..4ec6be44 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -181,15 +181,18 @@ if ($PARAM_CONFIG) { } # Invoke the WPFInstall function with the combined configuration - Invoke-WPFInstall -InstallConfig $combinedInstallConfig + Invoke-WPFInstall -PackagesToInstall $combinedInstallConfig } + if ($installConfig.WPFTweaks) { write-host "Running Tweaks" - Invoke-WPFtweaksbutton -TweaksConfig $installConfig.WPFTweaks + + Invoke-WPFtweaksbutton -Tweaks $installConfig.WPFTweaks } + if ($installConfig.WPFFeature) { write-host "Installing Features" - Invoke-WPFFeatureInstall -FeatureConfig $installConfig.WPFFeature + Invoke-WPFFeatureInstall -Features $installConfig.WPFFeature } } else { Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG