From b566d63ef2d1407f241721089b718d74a6dbc7e5 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 5 Aug 2024 22:49:44 +0200 Subject: [PATCH] Fix argument redirection --- scripts/Windows/Scripts/Software.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index 39f9ed41..e91dab19 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -12,7 +12,7 @@ $null = New-Module { [scriptblock] $Configurator = { }, [scriptblock] $UserConfigurator = { }, [InstallerAction] $Action = [InstallerAction]::Install, - [hashtable] $Arguments + [hashtable] $Arguments = @{ } ) if (-not $Name) { @@ -45,7 +45,8 @@ $null = New-Module { foreach ($user in Get-Users) { $Arguments.Add($userArgument, $user); - & $installHandler -Action ([InstallerAction]::ConfigureUser) -Arguments $Arguments; + $argumentList.Add("action", [InstallerAction]::ConfigureUser); + & $installHandler @argumentList; } } elseif ($Action -eq ([InstallerAction]::ConfigureUser)) { if ((-not $Arguments.ContainsKey($userArgument)) -or ($null -eq $Arguments[$userArgument])) {