diff --git a/test.ps1 b/test.ps1 index d948ea8..6364135 100644 --- a/test.ps1 +++ b/test.ps1 @@ -206,7 +206,8 @@ function Invoke-ServiceImagePathAudit { # Only "bad" if the exe path contains whitespace and is unquoted (it is) if ($exe -match '\s') { $badKey = "Yes" - $fixed = '"' + $exe + '"' + ($args ?? '') + $fixed = '"' + $exe + '"' + ($(if ($null -ne $args) { $args } else { '' })) + #PoSH 7 $fixed = '"' + $exe + '"' + ($args ?? '') } else { $badKey = "No" $fixed = "N/A"