did you get an exception in Debug mode or during automatic execution?
We have tested this. You get an error like this:
26832 exe3 0016 2019-02-04-21-40-31 Error Message:
PowerShell error:
Cannot bind argument to parameter 'Template' because it is null.
No Error Details.
Invocation Info:
Text: System.Management.Automation.InvocationInfo
Line: $Cc = (Invoke-KFTemplate -item $a -template $item["Cc"] -LocalConfig $Wildcards -ThrowErrors:$false -ErrorAction SilentlyContinue)
Col: 45
Script: C:\Source\wfengine\_workflows\empty-template-test\Workflow Script.ps1
Script Stack Trace:
at <ScriptBlock>, C:\Source\wfengine\_workflows\empty-template-test\Workflow Script.ps1: line 5
at <ScriptBlock>, <No file>: line 8
Error Id: ParameterArgumentValidationErrorNullNotAllowed,kenaflow.Cmdlets.InvokeKFTemplate
Stack Trace: **empty**
Inner Exception
Message:
Cannot bind argument to parameter 'Template' because it is null.
Stack Trace: **empty**
This is not an error that kenaflow can handle. It’s a pure PowerShell error. -ErrorAction (PowerShell) and -ThrowErrors are not able to catch this error.
The reason is that the -Template parameter of cmdlet Invoke-KFTemplate is $null. PowerShell (not kenaflow) cannot bind the $null value the the mandatory parameter -Template.
In our understanding it’s an error to pass an empty template into the template engine.
In this default cmdlet you get the same result when you pass in an $null value as parameter: