From 89abeada06cfe5759b9c7098a902fde92265a53c 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 c04960d5..3d0f9c22 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 4bb69dcd..0a02915c 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -175,13 +175,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 {