From 3708aa8e2b3d0854e2230b602800ed4b0d95d426 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 5 Aug 2024 22:51:29 +0200 Subject: [PATCH] Ensure `Arguments` contains an object --- scripts/Windows/Scripts/Software.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index e91dab19..10982563 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -12,9 +12,11 @@ $null = New-Module { [scriptblock] $Configurator = { }, [scriptblock] $UserConfigurator = { }, [InstallerAction] $Action = [InstallerAction]::Install, - [hashtable] $Arguments = @{ } + [hashtable] $Arguments ) + $Arguments ??= @{ }; + if (-not $Name) { $Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName)); }