From ea53352de6180d280b4b34d7304d6e3338e0e57f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 10 Aug 2024 15:15:21 +0200 Subject: [PATCH] Determine installer action properly --- scripts/Common/Scripts/Software.ps1 | 2 +- scripts/Windows/OS/Install.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Common/Scripts/Software.ps1 b/scripts/Common/Scripts/Software.ps1 index 3ad566d4..81346ee5 100644 --- a/scripts/Common/Scripts/Software.ps1 +++ b/scripts/Common/Scripts/Software.ps1 @@ -205,7 +205,7 @@ $null = New-Module { ) [InstallerAction] $Action = & { - if ($Action.HasValue) { + if ($null -ne $Action) { $Action; } else { [InstallerAction]::Install; diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 80ff76c6..ea542f70 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -178,13 +178,13 @@ $null = New-Module { #> function Deploy-SoftwareAction { param( - [InstallerAction] $Action + [InstallerAction] $Action = $null ) [bool] $install = $null; $arguments = [hashtable]@{ }; - if ($Action) { + if ($null -ne $Action) { $install = ($Action -eq ([InstallerAction]::Install)); $null = $arguments.Add("action", $Action); } else {