From ab6cb446de8ed4699c44f1ccff62453100f1509c Mon Sep 17 00:00:00 2001 From: dyoder Date: Thu, 3 Dec 2020 17:27:53 -0500 Subject: [PATCH] check for null arguments when calling Install-Program --- Tools.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools.ps1 b/Tools.ps1 index d3caa51..a5ea49a 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -179,7 +179,10 @@ Function Install-Program { ) If ( Test-Path "${Path}" ) { LogMsg "Running installer: ""${Path}"" ${Arguments}" - Try { Start-Process "${Path}" -ArgumentList "${Arguments}" -Wait } + Try { + If ( $Arguments -eq '' ) { Start-Process "${Path}" -Wait } + Else { Start-Process "${Path}" -ArgumentList "${Arguments}" -Wait } + } Catch { LogErr $_.Exception.Message } LogMsg "Installer finished" If ( $Delete ) {