directly passing param into correct var

This commit is contained in:
MyDrift 2024-08-26 13:25:03 +02:00
parent 979ab90d8c
commit a30b37168f
4 changed files with 14 additions and 17 deletions

View File

@ -7,7 +7,7 @@ function Invoke-WPFFeatureInstall {
#> #>
param ( param (
$FeatureConfig $Features
) )
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
@ -16,9 +16,7 @@ function Invoke-WPFFeatureInstall {
return return
} }
if ($FeatureConfig) { if ([string]::IsNullOrEmpty($Features)) {
$Features = $FeatureConfig
} else {
$Features = (Get-WinUtilCheckBoxes)["WPFFeature"] $Features = (Get-WinUtilCheckBoxes)["WPFFeature"]
} }

View File

@ -7,7 +7,7 @@ function Invoke-WPFInstall {
#> #>
param ( param (
$InstallConfig $PackagesToInstall
) )
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
@ -16,9 +16,7 @@ function Invoke-WPFInstall {
return return
} }
if ($InstallConfig) { if ([string]::IsNullOrEmpty($InstallConfig)) {
$PackagesToInstall = $InstallConfig
} else {
$PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"] $PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"]
} }

View File

@ -7,7 +7,7 @@ function Invoke-WPFtweaksbutton {
#> #>
param ( param (
$TweaksConfig $Tweaks
) )
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
@ -16,9 +16,7 @@ function Invoke-WPFtweaksbutton {
return return
} }
if ($TweaksConfig) { if ([string]::IsNullOrEmpty($Tweaks)) {
$Tweaks = $TweaksConfig
} else {
$Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"] $Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"]
} }
@ -32,8 +30,8 @@ function Invoke-WPFtweaksbutton {
Write-Debug "Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Number of tweaks to process: $($Tweaks.Count)"
Invoke-WPFRunspace -ArgumentList $Tweaks -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $Tweaks, $testvar -DebugPreference $DebugPreference -ScriptBlock {
param($Tweaks, $DebugPreference) param($Tweaks, $testvar, $DebugPreference)
Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)"
$sync.ProcessRunning = $true $sync.ProcessRunning = $true

View File

@ -181,15 +181,18 @@ if ($PARAM_CONFIG) {
} }
# Invoke the WPFInstall function with the combined configuration # Invoke the WPFInstall function with the combined configuration
Invoke-WPFInstall -InstallConfig $combinedInstallConfig Invoke-WPFInstall -PackagesToInstall $combinedInstallConfig
} }
if ($installConfig.WPFTweaks) { if ($installConfig.WPFTweaks) {
write-host "Running Tweaks" write-host "Running Tweaks"
Invoke-WPFtweaksbutton -TweaksConfig $installConfig.WPFTweaks
Invoke-WPFtweaksbutton -Tweaks $installConfig.WPFTweaks
} }
if ($installConfig.WPFFeature) { if ($installConfig.WPFFeature) {
write-host "Installing Features" write-host "Installing Features"
Invoke-WPFFeatureInstall -FeatureConfig $installConfig.WPFFeature Invoke-WPFFeatureInstall -Features $installConfig.WPFFeature
} }
} else { } else {
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG